OnChange Property

Gets or sets the name of the macro or script to be run when the Change event is triggered.

object.OnChange = [string]

Where object is an object expression that evaluates to one of the controls in the Applies To list, and string is a string expression specifying the script or macro to run when the change event is triggered.

Client support

   Newlook Smartclient

   Newlook Server

Use

Use this property to run a macro or script for the relevant control when the following occurs:

Control

Change Action

Checkbox control

The checked state of the control has changed. This can occur when the user clicks the control or the Value property is changed dynamically at runtime.

ComboBox control

The text in the text box portion of the control has changed. This can happen when the user selects an option from the drop down list, types into the text box area or the Text property of the control is dynamically modified at runtime.

Data control

The user changes the current record.

DataGrid control

The contents of an entry capable cell in the grid have changed. Occurs when the user changes the value of an entry capable cell or the contents of the Cell property are changed dynamically at runtime.

DateCombo control

The date in the text box portion of the control has changed. This can happen when the user selects a date from the calendar, types into the text box area or the Text property of the control is dynamically at runtime.

Label control

Occurs when the Caption property of the control is modified dynamically at runtime.

ListBox control

The user changes the list box selection or the ListIndex property is modified dynamically.

NumericCombo control

The date in the text box portion of the control has changed. This can happen when the user selects a value from the calculator, types into the text box area or the Text property of the control is dynamically changed at runtime.

OptionButton control

The selected state of this control has changed. This can occur when the user clicks the control (or another option button control in the group) or the Value property is modified dynamically.

ProgressBar control

The value property of the control has changed.

TextBox control

The text in the control has changed. This can occur when the user types a string into the text box or the Text property is updated dynamically.

TrackBar control

The user repositions the track thumb either by clicking the scroll bar buttons or repositioning the thumb manually. This event is also triggered when the Value property is updated dynamically.

UpDown control

The Value of the control has changed. This occurs after a user clicks the arrow buttons, or after the Value property has been updated dynamically. The Change event occurs after the Value property has been changed, and after the UpClick and DownClick events. This event cannot be canceled. Use this property to determine  the changed value of the control.

TIP:

The OnChange macro can synchronize or coordinate data display among controls. For example, you might use an OnChange macro to display customer data matching a text box’s customer order number.

WARNING:

A Change event procedure can sometimes cause a cascading event. This occurs when the control's Change event alters the control's contents, for example, by setting a property in a macro that determines the control's value, such as the Text property setting for a Text box control.

To prevent a cascading event:

See Also

OnClick property | Caption property | OnChange property | Text property | Value property

Applies To

Check box control

Combo box control

Data control

DataGrid control

Date combo box control

Label control

List box control

NumericCombo control

Option button control

ProgressBar control

ScrollBar control (control deprecated in version 10.5)

Text box control

TrackBar control

UpDown control


© 2004-2021 looksoftware. All rights reserved.