CHOOSECOLOR Method (System)
Description
Syntax
Color = Exec_Method( "SYSTEM", "CHOOSECOLOR", OwnerWindow, InitialColor )
Parameters
Name | Required | Description |
---|---|---|
OwnerWindow | No | ID of the parent window for the dialog. This can be null, in which case the parent window is the desktop. |
InitialColor | No | Initial color to select when the dialog is displayed. |
Returns
The color value the user selected, or null if the user clicked the "Cancel" button.
Remarks
The dialog supports a set of 16 custom colors that may be chosen by the user. They may be accessed at runtime via the SYSTEM CUSTOMCOLORS property and they are cached between instances of the dialog being executed and loaded automatically. They are not saved between OI sessions.
The CHOOSECOLOR method is basically a wrapper around the ChooseColor Windows API function, so further information on this can be found on the MSDN website.
Example
// Display the Windows ChooseColor dialog to allow the user to select a new // FORECOLOR for a control, using the current window as the parent InitColor = Get_Property( ctrlID, "FORECOLOR" ) NewColor = Exec_Method( "SYSTEM", "CHOOSECOLOR", @Window, InitColor ) If BLen( NewColor ) Then // The user selected a color Call Set_Property_Only( ctrlID, "FORECOLOR", NewColor ) End
See Also
CUSTOMCOLORS property