Modified

Syntax 1: For Ribbon controls

Description

This is a user event which occurs when the ribbon combo box control loses focus, the text has been changed, or Enter or Tab is pressed.

Make sure the parameter (quantities and types) of the user event is correctly defined according to the requirement of the ribbon combo box control.

Applies to

RibbonComboBoxItem controls

Arguments

Argument

Description

ItemHandle

Long. The handle of the item.


Return Values

Long.

Return code choices (specify in a RETURN statement):

0 -- Continue processing

Example

This example is a user event for a combo box; in this example, the Ue_ComboBoxModified user event must be defined with a long parameter for receiving the handle of the combo box that is modified.

//Ue_ComboBoxModified user event must have a long parameter for 
//receiving the handle of ComboBox that is modified
event type long ue_comboboxmodified(long itemhandle);
RibbonComboBoxItem lr_ComboBox
rbb_1.GetComboBox(ItemHandle,lr_ComboBox)
//...
return 1
end event

See also

Clicked

Selected

SelectionChanged

Syntax 2: For all other controls

Description

Occurs when the contents in the control have changed.

Event ID

Event ID

Objects

pbm_cbnmodified

DropDownListBox, DropDownPictureListBox

pbm_enmodified

SingleLineEdit, EditMask, MultiLineEdit

pbm_inkemodified

InkEdit

pbm_renmodified

RichTextEdit


Arguments

None

Return Values

Long.

Return code choices (specify in a RETURN statement):

0 -- Continue processing

Usage

For plain text controls, the Modified event occurs when the user indicates being finished by pressing Enter or tabbing away from the control.

For InkEdit and RichText Edit controls, the value of the Modified property controls the Modified event. If the property is false, the event occurs when the first change occurs to the contents of the control. The change also causes the property to be set to true, which suppresses the Modified event. You can restart checking for changes by setting the property back to false.

Resetting the Modified property is useful when you insert text or a document in the control, which triggers the event and sets the property (it is reporting the change to the control's contents). To find out when the user begins making changes to the content, set the Modified property back to false in the script that opens the document. When the user begins editing, the property will be reset to true and the event will occur again.

A Modified event can be followed by a LoseFocus event.

Examples

In this example, code in the Modified event performs validation on the text the user entered in a SingleLineEdit control sle_color. If the user did not enter RED, WHITE, or BLUE, a message box indicates what is valid input; for valid input, the color of the text changes:

string ls_color
 
This.BackColor = RGB(150,150,150)
 
ls_color = Upper(This.Text)
CHOOSE CASE ls_color
   CASE "RED"
      This.TextColor = RGB(255,0,0)
   CASE "BLUE"
      This.TextColor = RGB(0,0,255)
   CASE "WHITE"
      This.TextColor = RGB(255,255,255)
   CASE ELSE
      This.Text = ""
      MessageBox("Invalid input", &
      "Enter RED, WHITE, or BLUE.")
END CHOOSE

This is not a realistic example: user input of three specific choices is more suited to a list box; in a real situation, the allowed input might be more general.

See also

LoseFocus