GetColor Method
Description
Used in C# and VB.NET if running on Windows 2000 to set the background color of dialogs because C# and VB.NET can't automatically use dialogs' background colors from SkinFramework while running in Windows 2000.
Syntax
Public Function GetColor( _
ByVal Index As XTPColorManagerColor _
) As ULong
Parameters
Index
A color from the XTPColorManagerColor enumeration.
| Value | Description |
|---|---|
| STDCOLOR_BACKGROUND | Desktop color. |
| STDCOLOR_ACTIVECAPTION | Color of the title bar for the active window. Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled. |
| STDCOLOR_INACTIVECAPTION | Color of the title bar for the inactive window. Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled. |
| STDCOLOR_MENU | Menu background color. |
| STDCOLOR_WINDOW | Window background color. |
| STDCOLOR_WINDOWFRAME | Window frame color. |
| STDCOLOR_MENUTEXT | Color of text on menus. |
| STDCOLOR_WINDOWTEXT | Color of text in windows. |
| STDCOLOR_CAPTIONTEXT | Color of text in caption, size box, and scroll arrow. |
| STDCOLOR_ACTIVEBORDER | Border color of active window. |
| STDCOLOR_INACTIVEBORDER | Border color of inactive window. |
| STDCOLOR_APPWORKSPACE | Background color of multiple-document interface (MDI) applications. |
| STDCOLOR_HIGHLIGHT | Background color of items selected in a control. |
| STDCOLOR_HIGHLIGHTTEXT | Text color of items selected in a control. |
| STDCOLOR_BTNFACE | Face color for three-dimensional display elements and for dialog box backgrounds. |
| STDCOLOR_BTNSHADOW | Color of shading on the edge of command buttons. |
| STDCOLOR_GRAYTEXT | Grayed (disabled) text. |
| STDCOLOR_BTNTEXT | Text color on push buttons. |
| STDCOLOR_INACTIVECAPTIONTEXT | Color of text in an inactive caption. |
| STDCOLOR_BTNHIGHLIGHT | Highlight color for 3-D display elements. |
| STDCOLOR_3DDKSHADOW | Darkest shadow color for 3-D display elements. |
| STDCOLOR_3DLIGHT | Second lightest 3-D color after 3DHighlight. Light color for three-dimensional display elements (for edges facing the light source). |
| STDCOLOR_INFOTEXT | Color of text in ToolTips. |
| STDCOLOR_INFOBK | Background color of ToolTips. |
| STDCOLOR_HOTLIGHT | Color for a hot-tracked item. Single clicking a hot-tracked item executes the item. |
| STDCOLOR_GRADIENTACTIVECAPTION | Right side color in the color gradient of an active window's title bar. COLOR_ACTIVECAPTION specifies the left side color. |
| STDCOLOR_GRADIENTINACTIVECAPTION | Right side color in the color gradient of an inactive window's title bar. COLOR_INACTIVECAPTION specifies the left side color. |
| XPCOLOR_TOOLBAR_FACE | XP toolbar background color. |
| XPCOLOR_HIGHLIGHT | XP menu item selected color. |
| XPCOLOR_HIGHLIGHT_BORDER | XP menu item selected border color. |
| XPCOLOR_HIGHLIGHT_PUSHED | XP menu item pushed color. |
| XPCOLOR_HIGHLIGHT_CHECKED | XP menu item checked color. |
| XPCOLOR_HIGHLIGHT_CHECKED_BORDER | An RGB value that represents the XP menu item checked border color. |
| XPCOLOR_ICONSHADDOW | XP menu item icon shadow. |
| XPCOLOR_GRAYTEXT | XP menu item disabled text color. |
| XPCOLOR_TOOLBAR_GRIPPER | XP toolbar gripper color. |
| XPCOLOR_SEPARATOR | XP toolbar separator color. |
| XPCOLOR_DISABLED | XP menu icon disabled color. |
| XPCOLOR_MENUBAR_FACE | XP menu item text background color. |
| XPCOLOR_MENUBAR_EXPANDED | XP hidden menu commands background color. |
| XPCOLOR_MENUBAR_BORDER | XP menu border color. |
| XPCOLOR_MENUBAR_TEXT | XP menu item text color. |
| XPCOLOR_HIGHLIGHT_TEXT | XP menu item selected text color. |
| XPCOLOR_TOOLBAR_TEXT | XP toolbar text color. |
| XPCOLOR_PUSHED_TEXT | XP toolbar pushed text color. |
| XPCOLOR_TAB_INACTIVE_BACK | XP inactive tab background color. |
| XPCOLOR_TAB_INACTIVE_TEXT | XP inactive tab text color. |
| XPCOLOR_HIGHLIGHT_PUSHED_BORDER | An RGB value that represents the XP border color for pushed in 3D elements. |
| XPCOLOR_3DFACE | XP face color for three-dimensional display elements and for dialog box backgrounds. |
| XPCOLOR_3DSHADOW | XP shadow color for three-dimensional display elements (for edges facing away from the light source). |
| XPCOLOR_FRAME | XP frame color. |
| XPCOLOR_SPLITTER_FACE | XP splitter face color. |
| XPCOLOR_LABEL | Color for Command Bars label control. |
| XPCOLOR_STATICFRAME | WinXP Static frame color. |
Remarks
GetColor is needed in C# and VB.NET if running on Windows 2000. This is because C# and VB.NET can't automatically use dialogs' background colors from SkinFramework while running in Windows 2000. GetColor is not needed if using VB6 or if the application will not be run on Windows 2000.
Example
GetColor Sample for Windows 2000 (C#) This sample illustrates how you can code the OnVisibleChanged event of a dialog form in C# so that the background color is changed to match the current skin. This is required if running on Windows 2000 and using C# or VB.NET, possibly in other situations.
protected override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged(e);
if (this.Visible)
{
frmMain.skinFramework.ApplyWindow(this.Handle.ToInt32());
this.BackColor = frmMain.skinFramework.GetColor(XtremeSkinFramework.XTPColorManagerColor.STDCOLOR_BTNFACE);
}
}
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.