Results 1 to 7 of 7

Thread: Allignment question - Resolved

  1. #1

    Thread Starter
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519

    Question 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".

  2. #2
    Lively Member
    Join Date
    Apr 2003
    Posts
    114
    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.

  3. #3

    Thread Starter
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    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".

  4. #4
    Lively Member
    Join Date
    Apr 2003
    Posts
    114
    The right to left should be part of the enum:

    Label1.RightToLeft= RightToLeft.Yes
    I can do all things with VB.

  5. #5

    Thread Starter
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    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".

  6. #6
    Lively Member
    Join Date
    Apr 2003
    Posts
    114
    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.

  7. #7

    Thread Starter
    Frenzied Member RudyL's Avatar
    Join Date
    Mar 2001
    Location
    Chicago
    Posts
    1,519
    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
  •  



Click Here to Expand Forum to Full Width