次の方法で共有


RibbonDropDown.OfficeImageId Property

Definition

Gets or sets the image to display on the RibbonDropDown, 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 ID of a built-in Microsoft Office icon that serves as the icon for this control.

Examples

The following example assigns a Microsoft Office icon to a drop down box.

To run this code example, you must first perform the following steps:

  1. Add a Ribbon (Visual Designer) item to an Office project.

  2. Add a group to the custom tab.

  3. Add a drop down box to the group.

private void SetDropDownImage()
{
    dropDown1.OfficeImageId = "FilterToggleFilter";
    dropDown1.ShowImage = true;
}
Private Sub SetDropDownImage()
    DropDown1.OfficeImageId = "FilterToggleFilter"
    DropDown1.ShowImage = True
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.

The ShowImage property must be true for the control to display the image. When you set the OfficeImageId property at design time, Visual Studio automatically sets the ShowImage property to true. If you set the OfficeImageId property at run time, you must set the ShowImage property to true in your code.

Applies to