XpMenu is a nice program interface effect control, but it also has many shortcomings. I have recently made it a little modification. The reason is that I have a Toolbutton in the program, whose style = TBSButton When Style is changed to TBSCheck, it can display the effect, but the background is very deep. This button is used to indicate if a panel can be displayed. I hope that it is like OfficeXP's tool button, when the toolbar is displayed, the button is drawn on the button, not with a deep look color display. . The XPMenu Drawing Toolbar button is done by the TXPMenu.ToolBardRawbutton function, the prototype is as follows:
Procedure txpmenu.toolbardrawbutton (Sender: Ttoolbar; Button: ttomdrawState; var defaultdraw: boolean); Decide whether the button is displayed by the following code to display the border, and what color is used:
if (cdsHot in State) then begin if (cdsChecked in State) or (Button.Down) or (cdsSelected in State) then ACanvas.Brush.Color: = FCheckedAreaSelectColor else ACanvas.brush.color: = FBSelectColor; HasBorder: = true; Hasbkg: = true; end; if ((cdschecked in state) and not (cdshot in state)) The begin acanvas.brush.color: = fcheckedareAcolor; Hasborder: = true; HASBKG: = true; end; if (cdsindeeeeeeterminate ) and not (cdshot in state)....................................................... .. Therefore, as long as the corresponding judgment is added, and the Hasborder = true can achieve the effect I hope. The modified code is as follows: