I have a ToolStripButton that is used as a radio button. When it is checked, a blue outline surrounds the button, but there is no background color. It is not clear enough fo
You can provide your own tool strip renderer to draw the button's background the way you want them. This example code gives the checked button a very visible black background:
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
toolStrip1.Renderer = new MyRenderer();
}
private class MyRenderer : ToolStripProfessionalRenderer {
protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e) {
var btn = e.Item as ToolStripButton;
if (btn != null && btn.CheckOnClick && btn.Checked) {
Rectangle bounds = new Rectangle(Point.Empty, e.Item.Size);
e.Graphics.FillRectangle(Brushes.Black, bounds);
}
else base.OnRenderButtonBackground(e);
}
}
}