private void VNTable_Click(object sender, EventArgs e) { if (VNTable.SelectedRows.Count == 0) { return; } int i = VNTable.SelectedRows[0].Index; if (VNTable.GetRowDisplayRectangle(i, true).Contains(VNTable.PointToClient(MousePosition))) { return; } VNTable.ClearSelection(); }
private void VNTable_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 1) { VisualNovel vn = new VisualNovel(); VNList[e.RowIndex].CopyTo(ref vn); VNSettingsForm VNSet = new VNSettingsForm(vn); DialogResult res = VNSet.ShowDialog(); if (res == DialogResult.OK) { VNList[e.RowIndex] = vn; VNTable.Refresh(); } } }
private void VNTable_SelectionChanged(object sender, EventArgs e) { if (VNTable.IsCurrentCellInEditMode) { VNTable.EndEdit(); } if (VNTable.SelectedRows.Count == 0) { Up.Enabled = Down.Enabled = Select_Btn.Enabled = Delete.Enabled = false; } else { Select_Btn.Enabled = Delete.Enabled = true; Up.Enabled = VNTable.SelectedRows[0].Index > 0; Down.Enabled = VNTable.SelectedRows[0].Index < VNTable.Rows.Count - 1; } }
private void VNTable_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { VNTable.BeginEdit(false); }