I need to set fixed length of characters for the text box when writing name for shape where user write for 20 characters and if number of characters increased 20 characters, he can not write any character.
Like this snapshot:
We usually give power to the users not to screw up their diagrams, rather than restricting.
But… you could roll your own direct editing that supports this functionality. Good luck!