void batterListView_DoubleClick(object sender, System.EventArgs e) { if (batterListView.SelectedItems.Count == 1) { Batter btr = (Batter) batterListView.SelectedItems[0].Tag; ShowBatterForm frm = new ShowBatterForm(btr); frm.ShowDialog(); } }
private void toolStripViewPlayer_Click(object sender, EventArgs e) { if (playerGrid.SelectedRows.Count == 1) { Player player = (Player)playerGrid.SelectedRows[0].DataBoundItem; if (player is Batter) { ShowBatterForm frm = new ShowBatterForm((Batter)player); frm.ShowDialog(); } else if (player is Pitcher) { ShowPitcherForm frm = new ShowPitcherForm((Pitcher)player); frm.ShowDialog(); } else { MessageBox.Show("Invalid player type."); } } }