Visual Basic Reference

MaskColor Property

See Also    Example    Applies To

Returns or sets a color in a buttons picture to be a mask (that is, transparent).

Syntax

object.MaskColor [= color]

The MaskColor property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
color A value or constant that determines the color to be used as a mask, as described in Settings.

Settings

Visual Basic uses the Microsoft Windows operating environment red-green-blue (RGB) color scheme. The settings for color are:

Setting Description
Normal RGB colors Colors specified using the Color palette or by using the RGB or QBColor functions in code.
&H00C0C0C0 (Default) Light gray.

Remarks

If the system colors change, then the color which is transparent will change, making the look of your picture unpredictable. It is good programming practice to use non-system colors.

This property is used only when the UseMaskColor property is set to True and the button has a bitmap-style picture assigned to its Picture property. (Icons and metafiles already contain transparency information.)

If the MaskColor property is changed at run time, the button will redraw itself with the new color acting as a mask.