Variable Property
Applies To
TextBox, ProgressBar, TrackBar
Description
Gets or sets the name of a SPEL+ global variable (except arrays) used for the textbox display.
Usage
GGet Form.Control.Variable, var
GSet Form.Control.Variable, value
- Form
- Name of a form or string variable containing a form name.
- Control
- Name of a control or string variable containing a control name. The control must exist in the specified form.
- var
- String variable that will contain the value of the property.
- value
- String expression for the new value of the property.
Values
The name of a SPEL+ global variable (except arrays) in the current project.
Default: None
Remarks
When the Variable property is set to a SPEL+ global variable (except arrays), then the Text value is automatically updated at runtime to show the value of the variable.
When you set the TextBox Variable property to a global variable, by default RC+ automatically updates the TextBox Text value with the value of the variable at runtime. The Update property default value is True. If you want to allow a user to change the value of the same variable, you must set Update to False. This stops the auto update so the user can type in a new value.
When Update is set from False to True, RC+ sets the value of the variable to the new value entered by the user in the TextBox.
One method is to add a CheckBox above the TextBox called “Change Value” or some similar name. In the ChechkBox Click event, use GGet to get the checked state of the CheckBox and then use GSset to set the TextBox Update property. When the box is checked, set Update to False.
When you set the ProgressBar Variable property to a global variable, the progress bar will display the value of the variable. When you set the TrackBar Variable property to a global variable, the variable value is set by the track bar.
See Also
TextBox, ProgressBar, TrackBar, Value
Example
GSet frmMain.txtStatus.Variable, "g_Status$"