Results 1 to 3 of 3

Thread: Margins in a textbox

  1. #1
    Guest

    Post

    Can someone please tell me how to have margins in a textbox so that the type doesn't jam up against the top and sides?

    I've tried using a second, slightly larger textbox under the first to give the appearance of margins, but I ran into coding problems in resizing all the different forms and textboxes in my application.

    Any help would be appreciated!

    jaxon

  2. #2
    Member
    Join Date
    Jul 1999
    Posts
    42

    Post

    1) Create a user control.
    2) Set the border style to fixed single.
    3) Add a text box to the user control.
    4) Set the border style of the text box to None.
    4) Move and size the text box leaving margins at the right,top,left and bottom. Change the user control name in MText.
    5) Set the MultiLine property of the text box to true (if applicable).
    6) Add this code to the user control:

    Private Sub UserControl_Resize()
    Text1.Width = UserControl.ScaleWidth - 2 * Text1.Left
    Text1.Height = UserControl.ScaleHeight - 2 * Text1.Top
    End Sub

  3. #3
    Guest

    Post

    Alfred -

    Thanks again. I appreciate your willingness to help us new guys. I'll let you know how I did with this sometime early next week.

    jaxon

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