User Tools

Site Tools


setcolor_specify_color_for_menu_part_.htm
Navigation:  Templates > Guide to all Templates > Additional Libraries and Templates > MenuStyleManager Class > MenuStyleManager Methods >====== SetColor ( specify color for menu part ) ====== Previous pageReturn to chapter overviewNext page

SetColor(MenuPart, StartColor, EndColor,<; vertical >)

blk2blue.jpg

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)

See Also:     Init (initialize the MenuStyleManager object)

setcolor_specify_color_for_menu_part_.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1