Share via


CommandBarButtonClass.Mask Property

Gets or sets an IPictureDisp object representing the mask image of a CommandBarButton object. The mask image determines what parts of the button image are transparent. Read/write.

Namespace:  Microsoft.Office.Core
Assembly:  office (in office.dll)

Syntax

'Declaration
Public Overridable Property Mask As IPictureDisp
    Get
    Set
'Usage
Dim instance As CommandBarButtonClass
Dim value As IPictureDisp

value = instance.Mask

instance.Mask = value
public virtual IPictureDisp Mask { get; set; }

Property Value

Type: IPictureDisp

Implements

_CommandBarButton.Mask

Remarks

When you create an image that you plan on using as a mask image, all of the areas that you want to be transparent should be white, and all of the areas that you want to show should be black.

Always set the mask after you have set the picture for a CommandBarButton object.

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 sustitute 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.

See Also

Reference

CommandBarButtonClass Class

CommandBarButtonClass Members

Microsoft.Office.Core Namespace