IRibbonControl Interface


Represents the object passed into every Ribbon user interface (UI) control's callback procedure.

public interface class IRibbonControl
public interface IRibbonControl
Public Interface IRibbonControl


The following example, written in C#, shows two procedures called from the onAction event procedure of a Button control and a ToggleButton control. In the first procedure, the IRibbonControl object representing the control is passed into the procedure and a message box is displayed indicating that the button was pressed along with the ID of the button. The second procedure is similar to the first with the addition of a Boolean parameter indicating that the button was pressed.

<span class="label">public void ButtonOnAction(IRibbonControl control) 
   MessageBox.Show("Button clicked: " + control.Id); 

public void ToggleButtonOnAction(IRibbonControl control, bool pressed) 

...if (pressed) 

      MessageBox.Show("ToggleButton was switched on."); 

      MessageBox.Show("ToggleButton was switched off."); 



The IRibbonControl object contains the name (ID) of the control and the current Window object for the Ribbon UI control.



Represents the active window containing the Ribbon user interface that triggers a callback procedure. Read-only.


Gets the ID of the control specified in the Ribbon XML markup customization file. Read-only.


Used to store arbitrary strings and fetch them at runtime. Read-only

Applies to