/// <summary> /// 双击修改用户信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView3_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { int index = dataGridView3.CurrentCell.RowIndex; string userId = dataGridView3.Rows[index].Cells["id1"].Value.ToString(); AddUser frmadduser = new AddUser(Convert.ToInt32(userId)); frmadduser.ShowDialog(); } catch (Exception) { } }
/// <summary> /// 用户新增 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button11_Click(object sender, EventArgs e) { AddUser frmadduser = new AddUser(0); frmadduser.ShowDialog(); }