private void AddBookButton_Click(object sender, EventArgs e) { BookForm2 f = new BookForm2(); f.ShowDialog(this); f.Dispose(); }
private void EditBookButton_Click(object sender, EventArgs e) { if (BookGridView.SelectedRows.Count == 0) { MessageBox.Show("行を選択してください", "編集", MessageBoxButtons.OK); return; } BookForm2 f = new BookForm2(); f.SelectedBOOK_ISBN = BookGridView.SelectedRows[0].Cells["BOOK_ISBN"].Value.ToString(); f.ShowDialog(this); f.Dispose(); }
protected void OnCellContentDoubleClick(object sender, DataGridViewCellEventArgs args) { int row = args.RowIndex; //rowが-1ならカラムヘッダーがダブルクリックされた if (row == -1) { return; } BookForm2 bookForm2 = new BookForm2(); bookForm2.SelectedBOOK_ISBN = BookGridView.Rows[row].Cells["BOOK_ISBN"].Value.ToString(); bookForm2.ShowDialog(this); bookForm2.Dispose(); }