private void buttonChange_Click(object sender, EventArgs e) { try { FormChangeBook newForm = new FormChangeBook(Int32.Parse(dataGridViewB.CurrentRow.Cells[0].Value.ToString())); newForm.ParentAdminMainMenu = this; newForm.Show(); Hide(); } catch (NullReferenceException) { MessageBox.Show("Строка не выбрана"); } }