Results 1 to 3 of 3

Thread: Text Box text align [resolved]

  1. #1

    Thread Starter
    Addicted Member jordan23's Avatar
    Join Date
    Dec 2002
    Posts
    166

    Text Box text align [resolved]

    How do I align the text to center with the following code? Thanks.

    Code:
    TextBox myLbl = new TextBox();
    this.panel.Controls.Add(myLbl);					
    myLbl.Size = new Size(myWidth,myHeight);
    myLbl.Location = new Point(myWidth*i,j * myHeight);
    Last edited by jordan23; Apr 20th, 2005 at 11:17 AM.

  2. #2
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Text Box text align

    myLbl.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;

    ...why not just set the textbox's textalign property?

  3. #3

    Thread Starter
    Addicted Member jordan23's Avatar
    Join Date
    Dec 2002
    Posts
    166

    Re: Text Box text align

    Thanks for the help.

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