This is ridiculous! All I'm trying to do is select and deselect a toolstrip button when I click it, the same way the "Left Align" button I'm looking at right now is selected in this text editor.
So I try to call select on the button, but nothing happens. I found out the hard way that it's because the canSelect property is false, but it's read only, because it's calculated from other things (like whether it's visible etc.).
So I looked up what would make it true, so if I change that manually, then when I call select, it should work right?
Well the main thing is that there's an enumeration type called ControlStyle, which has a flag in it called Selectable. This enumeration is supposed to be hidden somewhere in Control, and it can only be changed by calling SetStyle(ControlStyle, bool) - so I guess I set one bool at a time to true or false.
I couldn't find it, but I managed to find it in a different project on a different computer in a different version of .NET (yay for potential incompatibilities! I think the other one it using VS2010 or something, maybe 2012).
Anyway, I only found it in Form, but I still can't find it in ToolStrip or ToolStripButton. Don't they inherit Control? And if not, how can I actually make them selectable, and WHY aren't they by DEFAULT?!?!
Also, I'd like to be able to select and deselect them independently so I can select multiple simultaneously so I can have image buttons that act like checkboxes.
I've spent a few hours on something that should have taken a few SECONDS and now I'm really aggravated! Please tell me how to do this.
Thanks.