User Tools

Site Tools


colordialog_return_chosen_color_.htm
Navigation:  Language Reference > 13 - Built-in Functions >====== COLORDIALOG (return chosen color) ====== Previous pageReturn to chapter overviewNext page

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

blk2blue.jpg

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

colordialog_return_chosen_color_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1