COLORDIALOG (return chosen color)

Top  Previous  Next

 

COLORDIALOG( [title] ,rgb [, suppress] )

COLORDIALOG

Displays the Windows standard color choice dialog box to allow the user to choose a color.

title

A string constant or variable containing the title to place on the color choice dialog. If omitted, a default title is supplied by Windows.

rgb

A LONG integer variable to receive the selected color.

suppress

An integer constant or variable containing either zero (0) or one (1). If one, the list of standard colors is suppressed. If omitted or zero (0) the list of standard colors is displayed.

The COLORDIALOG procedure displays the Windows standard color choice dialog box and returns the color chosen by the user in the rgb parameter. Any existing value in the rgb parameter sets the default color choice presented to the user in the color choice dialog. The color chosen by the user may be either an RGB value (a positive value) or one of the Windows standard element colors (a negative value).

COLORDIALOG returns zero (0) if the user pressed the Cancel button, or one (1) if the user pressed the Ok button on the color choice dialog.

Return Data Type:

SIGNED

Example:

MDIChild1 WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL

          !window controls

         END

 

ColorNow LONG

 

CODE

IF NOT COLORDIALOG('Choose Box Color',ColorNow)

 ColorNow = 000000FFh          !Default to Red if user pressed Cancel

END

OPEN(MDIChild1)

BOX(100,50,100,50,ColorNow)    !User-defined color for box

 

See Also:

COLOR

FONT