System
System
Set a color from a Windows system color
Integer property
Applies to: Color Object , Stock Color Object
Rather than set an explicit color for a color object using the Red, Blue and Green properties, it is possible to set it indirectly to one of the current Windows system colors. The object will then track any changes to the system color made using the display applet in the control panel or right clicking the desktop.
The constants for the system colors are not built into KCML but the following enumeration could be used
DEF ENUM GB_SystemColour DIM _GB_SystemColour_ActiveWindowBorder=11 DIM _GB_SystemColour_ActiveWindowCaption=3 DIM _GB_SystemColour_BackgroundOfMDIApps=13 DIM _GB_SystemColour_Desktop=2 DIM _GB_SystemColour_EdgeShadingOnPushButtons=17 DIM _GB_SystemColour_FaceShadingOnPushButtons=16 DIM _GB_SystemColour_GrayedDisabledText=18 DIM _GB_SystemColour_HighLightForButtons=21 DIM _GB_SystemColour_InactiveWindowBorder=12 DIM _GB_SystemColour_InactiveWindowCaption=4 DIM _GB_SystemColour_MenuBackground=5 DIM _GB_SystemColour_ScrollBarGrayArea=1 DIM _GB_SystemColour_SelectedItems=14 DIM _GB_SystemColour_TextInAnInactiveCaption=14 DIM _GB_SystemColour_TextInCaption=10 DIM _GB_SystemColour_TextInMenus=8 DIM _GB_SystemColour_TextInWindows=9 DIM _GB_SystemColour_TextOfSelectedItems=15 DIM _GB_SystemColour_TextOnPushButtons=19 DIM _GB_SystemColour_WindowBackGround=6 DIM _GB_SystemColour_WindowFrame=7 END ENUM
For example
DEFEVENT Form1.Create() OBJECT oColour = .form.CreateControl(_CONTROL_COLOR, _STYLE_NORMAL, OBJECT NULL) oGrayColor.System = _GB_SystemColour_GrayedDisabledText END EVENT DEFEVENT Form1.Show() Form1.lblControl1.TextColor = oGrayColor.Sym END EVENT