//su kien thanh progress bar private void tg_progress_Tick(object sender, EventArgs e) { if (progressBar1.Value > 0) progressBar1.Value--; if (progressBar1.Value == 0) { tg_progress.Stop(); ////////////////////////////////////////////////////////////AM THANH GAME OVER Thread a_gameover = new Thread(new ThreadStart(A_Gameover)); a_gameover.Start(); //foreach (KimCuong kc in mokimcuong.kimcuong) //{ // kc.Enabled = false; //} cout = 3; tg_kt.Stop(); if (MessageBox.Show("Game Over", "Thong Bao", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK) { Name f = new Name(diem); f.Show(); } } }
//su kien click button hint private void bt_Hint_Click(object sender, EventArgs e) { try { Hint(); if (Hint() == 0) { tg_progress.Stop(); //AM THANH NOMOVE Thread a_nomove = new Thread(new ThreadStart(A_nomove)); a_nomove.Start(); if (MessageBox.Show("No Moves =>> Game Over", "Thong Bao", MessageBoxButtons.OK, MessageBoxIcon.Stop) == DialogResult.OK) { //foreach (KimCuong kc in mokimcuong.kimcuong) //{ // kc.Enabled = false; //} cout = 3; Name f = new Name(diem); f.Show(); } return; } if (progressBar1.Value >= 5) progressBar1.Value -= 5; if (diem >= 5) diem -= 5; textBox1.Text = ("" + diem); } catch { MessageBox.Show("Ban Chua Bam New Game"); } }