private void buttonAddUser_Click(object sender, EventArgs e) { EditUser AddUserForm = new EditUser(null); AddUserForm.Owner = this; AddUserForm.ShowDialog(); }
private void buttonEditUser_Click(object sender, EventArgs e) { //Передаем данные строки в поля формы string[] userData = new string[dataGridViewUsers.CurrentRow.Cells.Count]; for (int i = 0; i < dataGridViewUsers.CurrentRow.Cells.Count; i++) { userData[i] = dataGridViewUsers.CurrentRow.Cells[i].Value.ToString(); } EditUser EditUserForm = new EditUser(userData); EditUserForm.Owner = this; EditUserForm.ShowDialog(); }