how to restrict the length of entries in text box to its width
问题 c#: By default text box accepts n number of entries, I want to restrict the entries to its width Is there any property in text box through which i can achive this, 回答1: You could compute the width of the text to be drawn and if it exceeds the textbox width then return. HERE you can find a great example. 回答2: default it accepts only 32767 of chars. You can set the MaxLength property of the textbox in the textbox property Hope you are using windows forms 回答3: Assuming WinForms, try this: