Ribbon.OnChange

Syntax

OnChange(Sender: Object; Args: IRibbonChangeEventArgs);

Parameters

Sender. The parameter that returns the component that has generated the event.

Args. The parameter that enables the user to determine event parameters.

Description

The OnChange event occurs when any ribbon control elements are used.

Comments

The event occurs when the buttons are pressed, the states of checkboxes and radio buttons are changed, any values are selected in the drop-down lists, and so on. The control, which operations have fired the event, can be received using the property of the argument of the Element event.

Example

Executing the example requires a form and the Ribbon component named Ribbon1 on the form. The specified procedure is set as a handler of the OnChange event of the Ribbon1 component.

Sub Ribbon1OnChange(Sender: Object; Args: IRibbonChangeEventArgs);
Var
    RibbonElemet: IBaseRibbonElement;
Begin
    RibbonElemet := Args.Element;
    Select Case RibbonElemet.Id
        /// <summary>
        /// Then follow  the blocks Case, in which required actions are implemented
        /// for controls, depending on their identifiers
        /// </summary>
    End Select;
End Sub Ribbon1OnChange;

The controls are checked by identifiers when the event is fired. Having specified his own Case blocks, the user can execute necessary actions, depending on which control was used to generate this event.

See also:

Ribbon