C++/CLI: make toolstripbuttons behave like radio buttons

I have been trying to build a toolstrip with ten buttons which act like radio buttons. In other words, when you click one toolstrip button, it is selected and whichever button was previously selected becomes unselected.

I have been using a for each loop, but the problem I encounter is that there is a label in the toolstrip. As the code loops through each toolStripItem, it eventually gets to the label, and it is unable to "unselect" the label, which crashes the program.

Is there a way to determine if a toolStripItem is a button?

Is there a different solution to this problem?

Thanks
Dan
For anyone interested later, the solution was to use dynamic casting:

ToolStripButton^ btn = dynamic_cast<ToolStripButton^>(sender);
Topic archived. No new replies allowed.