protected override void OnCheckedChanged(EventArgs e)
{
base.OnCheckedChanged(e);
// If this item is no longer in the checked state, do nothing.
if (!Checked) return;
// Clear the checked state for all siblings.
foreach (ToolStripItem item in Parent.Items)
{
ToolStripRadioButtonMenuItem radioItem =
item as ToolStripRadioButtonMenuItem;
if (radioItem != null && radioItem != this && radioItem.Checked)
{
radioItem.Checked = false;
// Only one item can be selected at a time,
// so there is no need to continue.
return;
}
}
}