Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TextBox Centering on UserForm (XP; SP3)

    Is it possible to center a textbox on a userform.

    As an example the textbox is populated with different lengths of text. I have TextAlign set to left and WordWrap and AutoSize set to True. The textbox does autosize properly from the left position (say 15) but for display purposes it would be better it it aligned itself to the center of the Userform and retaining the same Top position.

  2. #2
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TextBox Centering on UserForm (XP; SP3)

    You would have to use VBA code to set the textbox's Left property to:

    <code>
    TextBox1.Left = (UserForm1.Width - TextBox1.Width) / 2
    </code>
    Legare Coleman

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TextBox Centering on UserForm (XP; SP3)

    Legare,

    Thank you,
    John

Posting Permissions

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