|
-
Aug 4th, 2004, 12:24 PM
#1
Thread Starter
Frenzied Member
Allignment question - Resolved
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
Last edited by RudyL; Aug 4th, 2004 at 01:28 PM.
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Aug 4th, 2004, 12:28 PM
#2
Lively Member
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 can do all things with VB.
-
Aug 4th, 2004, 12:40 PM
#3
Thread Starter
Frenzied Member
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.
I get this error with that code..
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.
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Aug 4th, 2004, 12:47 PM
#4
Lively Member
The right to left should be part of the enum:
Label1.RightToLeft= RightToLeft.Yes
I can do all things with VB.
-
Aug 4th, 2004, 12:55 PM
#5
Thread Starter
Frenzied Member
Originally posted by ThomasJones
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..
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..
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
-
Aug 4th, 2004, 01:13 PM
#6
Lively Member
Sounds like you want the AutoSize property.
Label1.AutoSize=True
You may want to dock it to the right also.
Last edited by ThomasJones; Aug 4th, 2004 at 01:19 PM.
I can do all things with VB.
-
Aug 4th, 2004, 01:28 PM
#7
Thread Starter
Frenzied Member
Originally posted by ThomasJones
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!

Rudy
10 different ways to skin a cat and amazingly enough each and every one has the same result, the cat gets skinned! The same can be applied to code, so be nice and accept each others "preferences".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|