TextBox

Object List Hierarchy Next Object

Definition:

Used for displaying and editing text that is entered by the user or assigned to the control in code.

Icon: images/Phx00004.gif

Specialized Features:

The following tables list and describe the properties and methods added by TextBox. There are no added events.


Properties Use to...


LineCount Determine the number of lines of text. (Read only)

MaxLength Limit the number of characters a user may type into a textbox.

MultiLine Specify whether a text box can handle multiple lines of text.

ReadOnly Determine whether the user can type in the TextBox.

ScrollBars Specify whether a text box has horizontal, vertical, or both horizontal and vertical scroll bars.

SelLength Set or return the number of characters selected in the text box.

SelStart Set or return the starting point of text selected in the text box.

SelText Replace or return the string containing the currently selected text.


Methods Use to...


Clear Empty the contents of the TextBox.

Copy Copy the Selected text onto the Clipboard.

Cut Cut the selected text to the Clipboard.

Insert Insert a string at the current cursor position.

Paste Insert the contents of the clipboard at the current cursor position.

Undo Undo the most recent change.

Copied Features:

images/Phx00172.gif Properties images/Phx00173.gif Methods images/Phx00174.gif Events

Details:

A text box, or edit field, is a rectangular box in which a user can enter and edit information. The blinking insertion point appears in the text box when the box is given focus. While in a text box you can change the insertion point location by using the arrows or mouse, and you can perform cut, copy, paste operations just as you do with other Window applications. The font characteristics used in the text box are determined by its Font property.

The default text box setting of False, allows only a single line of text. To create a multiple-line text box, set the MultiLine property to True. Text in a multiple-line text box wraps automatically if the text box doesn't have a horizontal scroll bar. To add scroll bars to a text box, set the ScrollBars property to True.