Text Box State Properties

AutoHScroll and AutoVScroll

The AutoHScroll property gets or sets whether automatic horizontal scrolling is active. The AutoVScroll property gets or sets whether automatic vertical scrolling is active. When this property is true, a text box automatically scrolls the text in the control to the right or down when the user types a character at the end of the line. If false, only text that fits within the rectangular boundary is allowed. Changes to these properties will not be reflected until you close and reopen the worksheet.

bMode = TextBox.AutoHScroll          bMode = TextBox.AutoVScroll
TextBox.AutoHScroll = bMode         TextBox.AutoVScroll = bMode

Element

Description

bMode

True indicates that automatic scrolling is active; false indicates that it is not active.

CausesValidation Property

The CausesValidation property sets or gets whether validation occurs on the control which lost focus. Not commonly used in the Mathcad environment.

bMode = TextBox.CausesValidation
TextBox.CausesValidation = bMode

Element

Description

bMode

True indicates that the control causes validation; false indicates that it does not.

Enabled

The Enabled property sets or gets a whether an object can respond to user-generated events. A disabled text box can not receive any user events, so it is similar to a static label. Setting this property is equivalent to right-clicking on the control and choosing Disable Evaluation.

bMode = TextBox.Enabled
TextBox.Enabled = bMode

Element

Description

bMode

True indicates that the text box is enabled; false indicates that it is disabled.

HelpContextID

The HelpContextID property specifies the default Help file context ID for an object.

longVal = TextBox.HelpContextID
TextBox.HelpContextID = longVal

Element

Description

longVal

A long value that indicates the default Help file context ID for an object.

hWnd

The hWnd property gets the window handle of the window containing the control.

OLE_HANDLE = TextBox.hWnd

Element

Description

OLE_HANDLE

The handle of the window containing the control.

OEMConvert

The OEMConvert property is used to handle non-ANSI characters entered in the TextBox control. When this property is set, text entered in the edit control is converted from the ANSI character set to the OEM character set with a call to the AnsiToOem Windows function, and then back to ANSI. The OEMConvert property ensures proper character conversion for extended characters, such as accented vowels.

bMode = TextBox.OEMConvert
TextBox.OEMConvert = bMode

Element

Description

bMode

True indicates that the text box performs the conversion; false indicates that it does not.

Password

The Password property sets or gets whether input text is hidden with asterisks. This setting hides sensitive information, but does not secure the text. It merely hides the keystroke input as it is typed. The text is not encrypted.

bMode = TextBox.Password
TextBox.Password = bMode

Element

Description

bMode

True indicates that the text box text is visible to users as typed; false indicates that it is masked by asterisks.

ReadOnly

The ReadOnly property sets or gets whether the text is read-only or is editable.

bMode = TextBox.ReadOnly
TextBox.ReadOnly = bMode

Element

Description

bMode

True indicates that the text is read-only; false indicates that the text is editable.

RightToLeftReadingOrder

The RightToLeftReadingOrder property sets or gets a value that determines whether the text is read right-to-left. Often used for Kanji.

bMode = TextBox.RightToLeftReadingOrder
TextBox.RightToLeftReadingOrder = bMode

Element

Description

bMode

True indicates that the text ordering is right-to-left; false indicates left-to-right.

Text

The Text property sets or gets the text of the text box. This is probably the most commonly used property of this control to retrieve the contents of the text box.

stringText = TextBox.Text
TextBox.Text = stringText

Element

Description

stringText

A string that indicates the text of the text box.

WantsReturn

The WantsReturn property specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiple-line text box. This property is only available if the Multiline property has been set to true.

bMode = TextBox.WantsReturn
TextBox.WantsReturn = bMode

Element

Description

bMode

True indicates insert a carriage return in the block of text entered by the user; false has no effect on the control and is the default setting.