Navigation: Templates > Guide to all Templates > Additional Libraries and Templates > MenuStyleManager Class > MenuStyleManager Methods >====== SetColor ( specify color for menu part ) ====== | |
SetColor(MenuPart, StartColor, EndColor,<; vertical >)
MenuPart | A BYTE value representing the area of the menu to color. There is a series of internal equates available to easily identify these elements: |
MenuBrushes:NormalBkgnd | EQUATE(1) !Normal Background |
MenuBrushes:SelectedBkgnd | EQUATE(2) !Selected Background |
MenuBrushes:HotBkgnd | EQUATE(3) !Hot Background |
MenuBrushes:ImageBkgnd | EQUATE(4) !Image Background |
MenuBrushes:NormalBarBkgnd | EQUATE(5) !Normal Select Bar Background |
MenuBrushes:SelectedBarBkgnd | EQUATE(6) !Selected Bar Background |
MenuBrushes:GrayBrush | EQUATE(7) !Gray Brush |
MenuBrushes:FrameBrush | EQUATE(8) !Frame Brush |
StartColor | A LONG integer that specifies a starting color to use. If a gradient is active, this represents the starting color of the menu gradient. |
EndColor | A LONG integer that specifies a starting color to use. If a gradient is active, this represents the finishing color of the menu gradient. |
vertical | An optional BYTE value that specifies the direction of the color gradient. When TRUE (1), the direction of the gradient color is vertical. Otherwise, if omitted or False, the gradient is horizontal. |
The SetColor method is used to set a specific color gradient to a specified part of the active menu. In general, you may modify any individual part of a menu as specified by the MenuPart parameter, however most styles are a group of menu elements assigned to produce a specific look. See the example below for an illustration.
Implementation:
The SetColor method can be applied anytime after the Init method for the target menu has been executed.
Example:
MenuStyleMgr.SetColor(MenuBrushes:SelectedBkgnd,15331781,16764861,False)
MenuStyleMgr.SetColor(MenuBrushes:SelectedBarBkgnd,15331781,16760187,True)
MenuStyleMgr.SetColor(MenuBrushes:HotBkgnd,15331781,16764861,True)
MenuStyleMgr.SetColor(MenuBrushes:FrameBrush,12615680, 12615680,True)