private void MenuSyntaxClickCallback(object sender, EventArgs e) { /* Unselect previously selected menu items */ foreach (var item in _mnuSyntax.DropDownItems.Cast <ToolStripItem>().Where(item => item.GetType() == typeof(ToolStripMenuItem))) { ((ToolStripMenuItem)item).Checked = false; } LanguageControl.Syntax(sender, _tsFiles); }