1

I have a simple ToolStrip with buttons in it which contain images and text. When I go over that button it changes appearance (same when it gets clicked). How can I customize this so that it stays highlighted when clicked? I have to do this over a tabControl so that it stays highlighted when the tab is entered and gets back to its normal appearance when leaving the tab. Which methods do I have to override?

Thank you!

  • 2
    I'm not sure if that's the appearance you want, but try setting the `Checked` property of the button to `true` when the tab has been entered and to `false` when it's been left. – René Vogt Nov 28 '15 at 17:29
  • 1
    And for the methods: `TabControl` and`TabPage` both have events `Enter` and `Leave` which you can use. – René Vogt Nov 28 '15 at 17:36

1 Answers1

1

just set ToolStripButton.CheckOnClick property to true from design time. So it will stay highlited when clicked.

About the other requirement set ToolStripButton.Checked to true on entring the tab control, and set it to false on leaving the tab control.

For entering and leaving you may use Control.Leave & Control.Enter events of tabpage/tabcontrol.

Let me know incase of any issues

Kapoor
  • 1,388
  • 11
  • 21