c# winforms
I have twelve buttons on a ToolStrip, and want if they could work like a menu.
For each button clickEvent, i wrote:
foreach (ToolStripItem c in ToolStrip1.Items)
{
c.ForeColor = Color.Gray;
}
Button1.ForeColor = Color.Crimson; //Button1 replace with Button2, Button3...
I suppose there is a shorter way.
Maybe if could change the CheckOnClick event - not to change BackColor but ForeColor, and change foreColor back to Gray - if some other button is clicked ?
Is there a way, please ?
C# winforms - ToolStripButtons working like a menu
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Jaish MathewsRank #225 · 11K reputationPosted May 31, 2012, 12:57 AM EDT