TextBox

The TextBox control lets the user enter and edit text values. Typically, a user interface would send the value in a text control to a connected device when a button is clicked. However, text controls can send messages whenever the text value is changed. The value of the control can also be set by commands from a connected device.

Design-time Properties for the TextBox control
Property Description
Text The current value of the text displayed
TextAlign Sets whether the text is shown on the left, right or centered in the control
ScrollBars Sets which scroll bars are shown for the control
PasswordChar The control value is displayed using this character (if set). The underlying value is still available to commands though
UseSystemPasswordChar When true, the control value is displayed using the standard system password character (•). The underlying value is still available to commands though
MaxLength Limits the maximum length of text that can be entered
Multiline When true, multiple lines of text can be entered; if false only a single line of text is supported
AcceptsReturn When true, pressing the enter key creates a new-line in a multi-line control. If false, you’ll need to use Alt+Enter to create a new line.
AcceptsTab When true, pressing tab will insert a tab character into a multiline edit control. Otherwise it will move the focus to the next control
WordWrap When true, long lines of text will be wrapped inside multi-line controls.
ReadOnly If true, the user can’t edit text in the control
Run-time Properties for the TextBox control
Name Access Type Description
Name Read only string The name of the control
Text Read/write string The current value of the text displayed
TextLength Read only int Gets the length of text in the control
ReadOnly Read/write bool Controls whether the user can edit the text in the control

This control also supports all the common run-time properties.

Run-time Methods for the TextBox control
Name Returns Description
FixedLengthText(int Length) string Returns the first Length characters from the control value. If the value is shorter than Length spaces (‘ ‘) will be added to the end until it is exactly Length characters long.
FixedLengthText(int Length, string Alignment) string Returns the first Length characters from the control value. If the value is shorter than Length spaces (‘ ‘) will be added to the value until it is exactly Length characters long. Spaces are added to the start or end of the value when Alignment is Right or Left. If Alignment is Center an equal number of spaces is added to the start and end of the value.
FixedLengthText(int Length, string Alignment, char Padding) string Returns the first Length characters from the control value. If the value is shorter than Length the Padding character will be added to the value until it is exactly Length characters long. The Padding character is added to the start or end of the value when Alignment is Right or Left. If Alignment is Center an equal number of Padding characters is added to the start and end of the value.

Start typing and press Enter to search