private void Add_toolStripButton1_Click(object sender, EventArgs e) { //добавить AddRowCredForm CreateCredentials = new AddRowCredForm(CredentialsList); CreateCredentials.ShowDialog(); }
private void Edit_toolStripButton2_Click(object sender, EventArgs e) { //редактировать if (this.credentialsListDataGridView.CurrentCell != null) { AddRowCredForm EditCredentials = new AddRowCredForm(CredentialsList, credentialsListDataGridView.CurrentCell.RowIndex); DialogResult dr = EditCredentials.ShowDialog(); if (dr == DialogResult.Cancel) { } } //else //{ // MessageBox.Show("Выберите строку для редактирования."); // //AddRowCredForm CreateCredentials = new AddRowCredForm(CredentialsList, credentialsListDataGridView.CurrentCell.RowIndex); // //DialogResult dr = CreateCredentials.ShowDialog(); // //if (dr == DialogResult.Cancel) // //{ // //} //} }