TextBox Control

This control displays information entered by the user at run time or assigned to the Text property of the control at design or run time.

Syntax

TextBox

The TextBox control supports the following properties:

Alignment FontSize SelLength
Appearance Height SelStart
BackColor, ForeColor HideSelection SelText
BorderStyle HWnd TabIndex
Container Left TabStop
Enabled Locked Tag
Font MaxLength Text
FontBold MultiLine Top
FontItalic Name Visible
FontStrikethru Parent Width
FontUnderline PasswordChar  
FontName ScrollBars  

The TextBox control supports the following methods:

The TextBox control supports the following events:

Change KeyUp
Click LostFocus
DblClick MouseDown
GotFocus MouseMove
KeyDown MouseUp
KeyPress  

Remarks

Text entered into the TextBox control is contained in the Text property. You can enter up to 2,048 characters in a text box. If you set the MultiLine property of the control to True, you can enter up to 32 KB of text.

To display multiple lines of text in a TextBox control, set the MultiLine property to True. If a multiple-line TextBox does not have a horizontal scroll bar, text wraps automatically even when the TextBox is resized. To customize the scroll bar combination on a TextBox, set the ScrollBars property.

Scroll bars always appear on the TextBox when its MultiLine property is set to True and its ScrollBars property is set to anything except None (0).

If you set the MultiLine property to True, you can use the Alignment property to set the alignment of text within the TextBox. The text is left-justified by default. If the MultiLine property is False, setting the Alignment property has no effect.