private void cmdInfo_Click(object sender, EventArgs e) { if (lstGroups.SelectedIndex >= 0 && lstGroups.Items[lstGroups.SelectedIndex].ToString() != "none") { Group group = (Group)lstGroups.Items[lstGroups.SelectedIndex]; frmGroupInfo frm = new frmGroupInfo(group, Client); frm.ShowDialog(); } }