private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int id = Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value); FormUserAdd form = new FormUserAdd(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); FormUserAdd form = new FormUserAdd(id); form.ShowDialog(); }
private void toolStripButtonAdd_Click(object sender, EventArgs e) { FormUserAdd form = new FormUserAdd(0); form.ShowDialog(); }