Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IRibbonControl interface

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

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)
[TypeLibTypeAttribute()]
[GuidAttribute("000C0395-0000-0000-C000-000000000046")]
public interface IRibbonControl

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

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.

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."); 
 
 
   else 
      MessageBox.Show("ToggleButton was switched off."); 
 
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.