Ribbon.OnChange

Syntax

Sub OnChange(Sender: Object; Args: IRibbonChangeEventArgs);

Begin

//set of operators;

End Sub OnChange;

Parameters

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

Args - 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 it. The specified procedure has been 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
            //Then the Case blocks are followed, in which required actions are implemented
            //for controls, depending on their identifiers
        
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