CommandBarButtonClass.Picture Property

Definition

Gets or sets an IPictureDisp object representing the image of a CommandBarButton object. Read/write.

public:
 virtual property stdole::IPictureDisp ^ Picture { stdole::IPictureDisp ^ get(); void set(stdole::IPictureDisp ^ value); };
public virtual stdole.IPictureDisp Picture { get; set; }
member this.Picture : stdole.IPictureDisp with get, set
Public Overridable Property Picture As IPictureDisp

Property Value

Implements

Examples

The following example sets the image and mask of the first CommandBarButton that the code returns. To make this work, create a mask image and a button image and substitute the paths in the sample with the paths to your images.

The following example gets the image and mask of the first CommandBarButton that the code returns and outputs each of them to a file. To make this work, specify a path for the output files.

Remarks

When you change the image on a button, you will also want to use the Mask property to set a mask image. The mask image determines which parts of the button image are transparent. Always set the mask after you have set the picture for a CommandBarButton object.

Note: The images for the View MicrosoftApplication and Insert Item buttons on the Standard toolbar in the Visual Basic Editor cannot be changed.

Applies to