PDA

Click to See Complete Forum and Search --> : Margins in a textbox


Jul 23rd, 1999, 07:51 PM
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

Alfred
Jul 24th, 1999, 01:37 AM
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

Jul 24th, 1999, 03:57 AM
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