Visual Basic Reference

MaskColor Property (UserControl Object)

See Also    Example    Applies To

Returns or sets the color that determines the transparent region of the bitmap assigned to the MaskPicture property of a UserControl object whose BackStyle property is set to 0 (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
RGB colors Colors specified by using the Color palette or by using the RGB or QBColor functions in code.

Remarks

When a bitmap is assigned to the MaskPicture property of a UserControl whose BackStyle property is set to 0 (Transparent), the control becomes transparent wherever it is covered by areas of the bitmap that match the MaskColor property.

Mouse events that occur over the transparent areas are received by the container or by controls that would otherwise be covered by the UserControl.

If there is no bitmap assigned to the MaskPicture property, or if the BackStyle property of the UserControl is not set to 0 (Transparent), then setting the MaskColor property has no effect.

For further details, see the MaskPicture property of the UserControl object.

Note   Although MaskColor accepts the system color constants listed in the Visual Basic (VB) object library in the Object Browser, as described in Help for the BackColor and ForeColor properties, this is only useful if the MaskPicture bitmap contains a system color.