VS2010 WinForms Labels

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,530
Location
Lansing, MI; USA
Programming Experience
10+
I have a project where I need some help with the Winform's label control. I have a label that displays text kinda like a title to something (autosize = false, TextAlignment = MiddleCenter) and whenever the label control isn't wide enough to display the single line of text it tries to auto-wrap it causing half of the text to be chopped off at the top and half of it chopped off at the bottom. I would rather it stay on a single line and cut the text off from the right. Anyway I can do that?

I also have another label (multiple lines of text, autosize = false) in which case I would like a vertical scrollbar to appear when the label isn't tall enough (I would like the text to wrap in this case, which is does do already) do they can scroll to read it all. How do I do that?
 
1. I see what you describe when UseCompatibleTextRendering is True, not with False (default). For both those values setting AutoEllipsis to True seems to place the text on one line only, and then displays the ellipsis indicator.

2. I'd use a readonly, multi-line textbox with scrollbars turned on.
 
Back
Top