private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int id = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); FormMenuAdd form = new FormMenuAdd(id); form.ShowDialog(); }
private void toolStripButtonEdit_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count == 0) { MessageBox.Show("请选择要修改的数据!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } int id = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); FormMenuAdd form = new FormMenuAdd(id); form.ShowDialog(); }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { FormMenuAdd form = new FormMenuAdd(0); form.ShowDialog(); }