The TextBox control lets you enter and edit text values at run-time. 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.

TextBox control properties
Name Access Type Method Description
AcceptsReturn Design-only bool 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 Design-only bool When true, pressing tab will insert a tab character into a multiline edit control. Otherwise it will move the focus to the next control
MaxLength Design-only integer Limits the maximum length of text that can be entered
Multiline Design-only bool When true, multiple lines of text can be entered; if false only a single line of text is supported
Name Read only string The name of the control.
PasswordChar Design-only char The control value is displayed using this character (if set). The underlying value is still available to commands though.
ReadOnly Read/write bool SetReadOnly Controls whether the user can edit the text in the control.
ScrollBars Design-only Scrollbars Sets which scroll bars are shown for the control (none, horizontal only, vertical only, horizontal and vertical).
Text Read/write string SetText The current value of the text displayed.
TextAlign Design-only HorizontalAlignment Sets whether the text is shown on the left, right or centered in the control.
TextLength Read only int Gets the length of text in the control.
UseSystemPasswordChar Design-only bool When true, the control value is displayed using the standard system password character (•). The underlying value is still available to commands though.
WordWrap Design-only bool When true, long lines of text will be wrapped inside multi-line controls.

This control also supports all the common control properties. It also supports the following methods, which can be used when creating serial commands.

TextBox control methods
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