How to indicate that there is more text in a C # winforms single line text box?

Sometimes a fixed-width text box, single-line in winforms with C # Visual Studio 2010 contains only the right-hand character width, the border between two characters (or words) aligns with the edge of the text box, making it impossible to say that there is more text without clicking and not by dragging with the mouse.

What are the best methods for determining the amount of text?

+4
source share
3 answers

Or just do not use a single line text field

Or, as I did .. created a custom text field element that inherits the TextBox class, and made it look like Shekha... when it overflows and it is not focused, and when it has focus, set the text to Shekhar_Pro or whatever nor was it originally.

+4
source

I used the code in this codeproject.com article:

Autoellipse

The author extends the TextBox to create a text box control that shortens the text to fit and does a reasonable job of using ellipses to indicate that it should have done so.

+1
source

This can not be a real problem, the user typed the text himself a minute ago. She knows that the text is cropped.

Make sure you are not using TextBox to display text yourself. This requires a shortcut. And the AutoEllipsis property automatically displays ... if the text does not match the maximum size of the label. And an automatic tooltip to display the rest.

+1
source

Source: https://habr.com/ru/post/1339288/


All Articles