Desktop Application Object - CreateColorDialog Method

Create an instance of the Color Picker

Member of Desktop Application Object (PRIM_APPL)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)PRIM_APPL.ICommonDialogColorReference to the newly created dialog

Details

The CreateColorDialog method is used to create an instance of the Windows Color Dialog.

Example

Using the color dialog to set the background color.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM ) Clientwidth(551) Clientheight(301) Left(165) Top(204) Width(567) Style(#Style1)
 
   Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1)
   Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(255:255:255)
 
   Define_Com Class(#PRIM_PHBN) Name(#Pick) Caption('Pick a Color') Displayposition(1) Left(16) Parent(#COM_OWNER) Tabposition(1) Top(16) Width(129)
 
   Evtroutine Handling(#Pick.Click)
 
      #Com_owner.PickColor
 
   Endroutine
 
   Mthroutine Name(PickColor)
 
      Define_Com Class(#Prim_appl.ICommonDialogColor) Name(#ColorDialog) Reference(*Dynamic)
 
      #ColorDialog <= #sys_appln.CreateColorDialog
 
      If (#ColorDialog.Show)
 
         #Brush1.Color := #ColorDialog.ChosenColor
 
      Endif
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2