Export (0) Print
Expand All
0 out of 7 rated this helpful - Rate this topic

How to: Create Toggle Buttons in ToolStrip Controls

When a user clicks a toggle button, it appears sunken and retains the sunken appearance until the user clicks the button again.

To create a toggling ToolStripButton

  • Use code such as the following code example. This code assumes that your form contains a ToolStrip control, and that its Items collection contains a ToolStripButton called toolStripButton1. It also assumes that you have an event handler called toolStripButton1_CheckedChanged.

    [Visual Basic]

    toolStripButton1.CheckOnClick = True
    toolStripButton1.CheckedChanged AddressOf _
    EventHandler(toolStripButton1_CheckedChanged);
    

    [C#]

    toolStripButton1.CheckOnClick = true;
    toolStripButton1.CheckedChanged += new _
    EventHandler(toolStripButton1_CheckedChanged);
    
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.