Sub OnChange(Sender: Object; Args: IRibbonChangeEventArgs);
Begin
//set of operators;
End Sub OnChange;
The Sender parameter returns the component that has generated the event.
The Args parameter allows to determine event parameters.
The OnChange event occurs when any ribbon control elements are used.
The event occurs when the buttons are pressed, the states of flags and switches are changed, any values are selected from the drop-down lists and so on. The control, the operations on which have fired the event, can be received using the property of the argument of the Element event.
Executing the example requires a form and the Ribbon component named Ribbon1 positioned on it. The specified procedure has been set as a handler of the OnChange event of the Ribbon1 component.
The control elements are checked by identifiers when the event is activated. Having specified his own Case blocks, the user can perform necessary actions depending on which control element this event was generated.
See also: