RibbonLoadImageEventArgs Interface


Provides data for the LoadImage event.

Namespace:   Microsoft.Office.Tools.Ribbon
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

public interface RibbonLoadImageEventArgs


Gets or sets the image of a Ribbon control that you want to load.


Gets the name of the image that is being loaded in the Ribbon.

Handle the LoadImage event if you want to load an image that is identified by the ImageName property of a control. The Microsoft Office application retrieves this image from your solution only once, when the Ribbon is displayed, to improve performance. After that, the control image cannot be changed.

To load an image for a control, add code to the LoadImage event handler. If the ImageName property of the RibbonLoadImageEventArgs matches the ImageName property of the control, set the Image property to the image that you want to load.

The following example caches the images for two RibbonButton controls.

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 two buttons to the group.

  4. Add two images to the project resources.

private void Ribbon1_LoadImage(object sender, RibbonLoadImageEventArgs e)
    switch (e.ImageName)
        case "Button1Image":
            e.Image = Properties.Resources.Image1;
        case "Button2Image":
            e.Image = Properties.Resources.Image2;
Return to top