Centering label text?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Centering label text?

  1. #1
    Join Date
    Sep 2011
    Posts
    5

    Centering label text?

    Just wondering, how do I center the text in a label that is changed by variables, I want to have it set in the top middle of my form, but I have no idea how to do it. C++ .NET in Visual studio, thanks ahead of time.

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,595

    Re: Centering label text?

    Set the label's AutoSize property to false (that's basically the trick to know here), adjust its size and position as desired at design time and set its TextAlign property to one of the three options that end with "Center".
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Sep 2011
    Posts
    5

    Re: Centering label text?

    Oh, never thought about autosize... Thanks =D

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center