private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.SelectedCells.Count != -1) { frmRequestView fm1 = new frmRequestView(); fm1.id = dataGridView1.SelectedCells[0].Value.ToString(); fm1.Show(); } }
private void dataGridView1_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.SelectedCells.Count != -1) { frmRequestView fm1 = new frmRequestView(); try { fm1.id = dataGridView1.SelectedCells[0].Value.ToString(); fm1.stuID = stuNameValue.Text; if (fm1.ShowDialog() == DialogResult.OK) { this.frmStudent_Load(sender, e); } } catch { MessageBox.Show("你尚未选择相应条目", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } else { MessageBox.Show("你尚未选择相应条目", "错误", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }