RibbonDropDownItem.OfficeImageId Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the image to display on the RibbonDropDownItem, if you want to use a built-in Microsoft Office icon.
public:
property System::String ^ OfficeImageId { System::String ^ get(); void set(System::String ^ value); };
public string OfficeImageId { get; set; }
member this.OfficeImageId : string with get, set
Public Property OfficeImageId As String
Property Value
The image to display on the RibbonDropDownItem, if you want to use a built-in Microsoft Office icon.
Examples
The following example assigns Microsoft Office icons to two items in a drop down box.
To run this code example, you must first perform the following steps:
Add a Ribbon (Visual Designer) item to a project created by using Office development tools in Visual Studio.
Add a group to the custom tab.
Add a drop down box to the group.
private void PopulateDropDown()
{
RibbonDropDownItem status1 = this.Factory.CreateRibbonDropDownItem();
status1.Label = "Away";
status1.OfficeImageId = "PersonaStatusAway";
dropDown1.Items.Add(status1);
RibbonDropDownItem status2 = this.Factory.CreateRibbonDropDownItem();
status2.Label = "Online";
status2.OfficeImageId = "PersonaStatusOnline";
dropDown1.Items.Add(status2);
}
Private Sub PopulateDropDown()
Dim status1 As RibbonDropDownItem = Me.Factory.CreateRibbonDropDownItem()
status1.Label = "Away"
status1.OfficeImageId = "PersonaStatusAway"
DropDown1.Items.Add(status1)
Dim status2 As RibbonDropDownItem = Me.Factory.CreateRibbonDropDownItem()
status2.Label = "Online"
status2.OfficeImageId = "PersonaStatusOnline"
DropDown1.Items.Add(status2)
End Sub
Remarks
The OfficeImageId property identifies an Office icon that is displayed by the control. The property value is a string that identifies the imageMso
value of the selected icon. This property can be set at design time or at run time. If you update this property at run time, the control's appearance is updated to reflect the change.
For a list of imageMso
values, see the Microsoft Download Center page Office 2010 Add-In: Icons Gallery.
This property is ignored if the Image property is set. Images identified by the OfficeImageId property can be loaded slightly faster than images identified by the Image property, because the images are cached in the Office application.