vb.netcheckboxtoolstriptoolstripbutton

Show CheckBox on ToolStripButton


I know that the ToolStripButton has checkbox functionality and should be used when you need a checkbox on a ToolStrip. However, the blue outline that appears to be the only indication of being Checked doesn't exactly scream "Hey, this is a checkbox!" to users. I could have sworn that I had previously found a way to get a ToolStripButton to show a checkbox in lieu of an image before, but apparently I deleted that instance after I decided on a different UI scheme for what I needed it for then; and I can't for the life of me seem to figure out how I got it working before.

Maybe all I did was add an image of a check; however, I would expect that my Resources would still have an image that I used for an unchecked state if that were the case. Is there any way to get a ToolStripButton to show an actual checkbox without resorting to making it myself?


Solution

  • Create your own component inheriting ToolStripControlHost that hosts a CheckBox control. That's exactly what the ToolStripComboBox, ToolStripProgressBar and ToolStripTextBox components do for ComboBox, ProgressBar and TextBox controls.