checkbox in a toolstrip

H

halex2000

Hi, I've used a toolstrip up until now for my program, but I've just
discovered that it doesn't support checkboxes. Is there a way to put one in
a toolstrip? I could also use a state button instead: a button, that is,
that keeps a 'pressed' state when clicked, and a 'released' state when
clicked again, but I don't find this functionality in the toolstripbutton
class.
Is there a solution for my problem?
Thank you!
 
G

Guest

For the check box in the toolstrip you need to use a ToolStripControlHost.
pass the checkbox to the constructor, then add it to the toolstip.

As the checked state. The ToolStripButton has a checked property you can
toggle, if you dont want to repeat the code the i suggest inheriting a new
one.
 
H

halex2000

Thank you very much! I already gave a look to this class, but I understood
that I was supposed to derive a class from this one, not just passing the
CheckBox to the contructor.
Well, it works, thank you again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top