How do I know how many characters fit into the remaining space in the TextBox?

I have a textbox with a specific width and line. How do you know how many characters are coming from the end of the line to the end of the line?

+2


source to share


2 answers


The number of characters that will fit depends on the font and on which characters. If you know what characters you are using, or are using a fixed width font, you can use Graphics.MeasureString () .



+4


source


you can't, first because different characters take different widths and second because the text is rendered differently on different platforms.



-3


source







All Articles