Share via


Visual Basic: CommonDialog Control

Flags Property (Color Dialog)

See Also   Example   Applies To

Returns or sets the options for a Color dialog box.

Syntax

object**.Flags** [= value]

The Flags property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A constant or value specifying the options for a Color dialog box, as described in Settings.

Settings

The settings for value are:

Constant Value Description
cdlCCFullOpen &H2 Entire dialog box is displayed, including the Define Custom Colors section.
cdlCCHelpButton &H8 Causes the dialog box to display a Help button.
cdlCCPreventFullOpen &H4 Disables the Define Custom Colors command button and prevents the user from defining custom colors.
cdlCCRGBInit &H1 Sets the initial color value for the dialog box.

Remarks

These constants are listed in the Microsoft CommonDialog Control (MSComDlg) object library in the Object Browser.

You can also define selected flags. Use the Const keyword in the Declarations section of the startup form to define the flags you want to use.

You can set more than one flag for a dialog box using the Or operator. For example:

CommonDialog1.Flags = &H10& Or &H200&

Adding the desired constant values produces the same results. The following is equivalent to the preceding example:

CommonDialog1.Flags = &H210& 

Data Type

Long