public void EventKeyPressed(object sender, KeyEventArgs e) { if (e.KeyCode >= Keys.D1 && e.KeyCode <= Keys.D9) { Sudoku.CheckCorrect_Replace(cp_matrix, e.KeyCode.ToString()[1], (Button)sender, buttons); } else if (e.KeyCode == Keys.Back) { Sudoku.BackSpaceDel(cp_matrix, (Button)sender, buttons); } if (Hint.CheckCompletition(cp_matrix)) { Form3 f3 = new Form3(); Hide(); stopwatch.Stop(); f3.ShowDialog(); Close(); } }
private void button82_Click(object sender, EventArgs e) { //The hint Button var coordinates = new Sudoku.coords(); coordinates = Hint.ReplaceRandom(); Hint.hint_uses++; buttons[coordinates.i, coordinates.j].Text = cp_matrix[coordinates.i, coordinates.j].ToString(); buttons[coordinates.i, coordinates.j].BackColor = Color.AliceBlue; if (Hint.CheckCompletition(cp_matrix)) { Form3 f3 = new Form3(); Hide(); stopwatch.Stop(); f3.ShowDialog(); Close(); return; } }