Label AutoSize property does not work properly

  • Thread starter Thread starter Harvey
  • Start date Start date
H

Harvey

Hello:

I am trying to use Autosize=true on a long string and it
extends off of my form, rather than increasing the number
of lines of the Label as the documentation says it should
do.

Would anyone know what other property I need to set to get
this to work properly? I have looked through them all and
cant find any. PreferredHeight is read only.

thank you in advance.
 
I have found when using labels with large amounts of text,
it's better to size it myself. If you size the control to
fit within an area that you're comfortable with, the
control behaves better with auto-size off. If you look at
the property description of AutoSize in the Property
sheet, it says "Enables automatic resizing based on font
size. Note that this is only valid for label controls
that don't wrap text.". I have no idea which label
controls do wrap text. The standard label provides no
capability for this. You could use a textbox control with
MultiLine = True and WordWrap set to true. That might
give you the desired effect. You could play with the
colors and lock it to make it appear to be a label. Just
a thought.
 
Back
Top