How do I set the allignment property for a label?
I want to make some Center, Some Left to Right and others right to left but I can not find the property..
Rudy
Printable View
How do I set the allignment property for a label?
I want to make some Center, Some Left to Right and others right to left but I can not find the property..
Rudy
TextAlign and RightToLeft Properties.
Label1.RightToLeft = True
Label1.TextAlign = BottomCenter
If you want the label it self to be aligned, then the dock property may help.
I get this error with that code..Quote:
Originally posted by ThomasJones
TextAlign and RightToLeft Properties.
Label1.RightToLeft = True
Label1.TextAlign = BottomCenter
If you want the label it self to be aligned, then the dock property may help.
Quote:
An unhandled exception of type 'System.ComponentModel.InvalidEnumArgumentException' occurred in system.windows.forms.dll
Additional information: Enum argument value -1 is not valid for RightToLeft. RightToLeft should be a value from RightToLeft.
The right to left should be part of the enum:
Label1.RightToLeft= RightToLeft.Yes
Ok, That worked.. Well I didn't get the error but it still is not alighning from right to left..Quote:
Originally posted by ThomasJones
The right to left should be part of the enum:
Label1.RightToLeft= RightToLeft.Yes
Here is me setup (in case I am thinking wrong).
On my form I have a label all the way on the right side. THe text varies in that label and I need to to adjust accordingly.. Expanding to the left..
Sounds like you want the AutoSize property.
Label1.AutoSize=True
You may want to dock it to the right also.
ahhhh Had the autosize.. but not the Dock.. Thanks!Quote:
Originally posted by ThomasJones
Sounds like you want the AutoSize property.
Label1.AutoSize=True
You may want to dock it to the right also.
:)
Rudy