private void check(int x, int y) { int i = 0; if (flag_x_y == true && flag == true) { lib[x, y].Text = but.STR(); } else { MessageBox.Show("This number has already existed"); if (flag_x_y == false) { label85.Text = CountOfError.ToString(); } else if (flag == false) { label85.Text = CountOfError.ToString(); } if (error == CountOfError) { DialogResult dr = MessageBox.Show("A lot of mistakes!", "Would you try again?", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { restart(); } else if (dr == DialogResult.No) { this.Close(); } } } for (int z = 0; z < 9; z++) { for (int c = 0; c < 9; c++) { lib[z, c].BackColor = Color.White; if (lib[z, c].Text.ToString() != " ") { i++; } } } if (i == 81) { the_transition_to_a_new_level level = new the_transition_to_a_new_level(specznak, ryven); if (level.ShowDialog() == DialogResult.OK) { New_Game(); } else if (level.DialogResult == DialogResult.Retry) { restart(); } else if (level.DialogResult == DialogResult.No) { this.Close(); } } }
private void check(int x, int y) { int i = 0; if (flag_x_y == true && flag == true) { lib[x, y].Text = but.STR(); } else { MessageBox.Show("эта цифра уже существует"); if (flag_x_y == false) { label85.Text = error.ToString(); } else if (flag == false) { label85.Text = error.ToString(); } if (ohibki == error) { DialogResult dr = MessageBox.Show("хотите начать заеово ..!?", "вы проиграли ...!! Вы злелоли много ошибок", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { restaet(); } else if (dr == DialogResult.No) { this.Close(); } } } for (int z = 0; z < 9; z++) { for (int c = 0; c < 9; c++) { lib[z, c].BackColor = Color.White; if (lib[z, c].Text.ToString() != " ") { i++; } } } if (i == 81) { the_transition_to_a_new_level level = new the_transition_to_a_new_level(specznak, slojnost); if (level.ShowDialog() == DialogResult.OK) { NEw_Games(); } else if (level.DialogResult == DialogResult.Retry) { restaet(); } else if (level.DialogResult == DialogResult.No) { this.Close(); } } }