TextBox Control
Description
Text boxes are used to get input from the operator or to display text. The TextBox control is generally used for editable text, although it can also be made read-only.
Text boxes can display multiple lines, and wrap text to the size of the control.
The TextBox control allows a single format for text displayed or entered in the control.
Usage
A TextBox can be used in single line mode or multiline mode.
Single line textbox
By default, when a TextBox is created, it is in single line mode. You can only change the width of the control. The user can only type in one line of characters.
Multiline textbox
To use multiline mode, set the Multiline property to True. In this mode, you can change the height and width of the control. You can display scrollbars by setting the Scrollbars property.
Setting TextBox Appearance
Use the BorderStyle, ForeColor, BackColor, Font, and TextAlign properties to change the appearance of the textbox.
Displaying SPEL+ Global Variable (Except Arrays) Status
You can display the value of a SPEL+ global variable automatically by setting the Variable property.
NOTE
If the SPEL+ global variable is not displayed by the setting of Variable property, rebuild the project.
TextBox Control Properties
Property | Description |
---|---|
AppendText | Append text at runtime. (Only available from SPEL+ programs) |
BackColor | The background color for the control. Default: Window |
BorderStyle | The border used for the control. Default: Fixed3D |
Enabled | Sets whether the control is enabled at runtime. Default: True |
EventTaskType | The type of task used for events. Default: Normal |
Font | The font for the control text. Default: Microsoft Sans Serif 8.25 pt |
FontBold | The bold attribute for the current font Default: False |
FontItalic | The italic attribute for the current font Default: False |
FontName | The name for the current font Default: Microsoft Sans Serif |
FontSize | The size for the current font in points Default: 8.25 |
ForeColor | The foreground color for the control text. Default: WindowText |
Height | The height of the control in pixels. |
Left | The left coordinate of the control in pixels. |
Multiline | Sets whether to display one line or multiple lines. Default: False |
Name | The name of the control. Default: TextBoxXX |
PasswordChar | Sets the character used to hide each character that is entered. Default: Empty |
ReadOnly | Sets whether the user can edit text or not. Default: False |
ScrollBars | Sets how to display the scrollbars for the control. Default: None |
ShowPrint | Sets whether to display output from Print statements or not. Default False |
TabIndex | The tab index of the control. |
Text | The text of the control. Default: Empty |
TextAlign | Selects the text alignment. Default: Left |
ToolTipText | The text used in the control’s tooltip. Default: Empty |
Top | The top coordinate of the control in pixels. |
Update | Updates the display of textbox control (Only available from SPEL+ programs). |
Variable | This is an optional SPEL+ global variable (except arrays). Default: None |
Visible | Whether the control is visible or not at runtime. Default: True |
Width | The width of the control in pixels. |
WordWrap | Sets whether to wrap words or not. Default: True |
TextBox Control Events
Event | Description |
---|---|
KeyPress | This event occurs when the control has focus and a key is pressed. |
Click | Executes when the user clicks the control with the mouse. |