C # WinForm Program ToolStrip ToolStripButton background is blue, how to change the background and border color and style it?
Implementing this feature requires overriding the ToolStripButton paint method
Here are just some ideas and ways to solve the problem, such as when the mouse pointer over the button, the background will turn black
The implementation code is as follows:
ToolStripButton TSB = (ToolStripButton) sender; Rectangle Rectbutton = TSB. Bounds; Point P = toolstrip1.pointtoclient (control.mouseposition); if (Rectbutton.contains (p)) { e.graphics.clear (systemcolors.controltext); if (TSB. Image! = null) { e.graphics.drawimage (TSB. Image, New Point (E.CLIPRECTANGLE.WIDTH-TSB. Image.width)/2, (E.CLIPRECTANGLE.HEIGHT-TSB. Image.height)/2)); } }
Source Download:C#winform program ToolStripButton Custom Background application example source code