private void GetPositions_Click(object sender, EventArgs e) { QueensPosition queens = new QueensPosition(); List <Position> positions = queens.GetPositions(); SetDGV(positions); }
private void DGV_CellClick(object sender, DataGridViewCellEventArgs e) { QueensPosition queens = new QueensPosition(); List <Position> positions = queens.GetPositions(new Position(e.ColumnIndex, e.RowIndex), out bool res); if (res) { SetDGV(positions); } else { MessageBox.Show("расстановка невозможна"); } }