private void exitGameToolStripMenuItem_Click(object sender, EventArgs e) { StopGame(); DialogResult rs = MessageBox.Show("Bạn có chắc muốn thoát game không", "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (rs == DialogResult.Yes) { Application.Exit(); } else { pic_pau_st.Image = Properties.Resources.pause_icon; TM_BiaVang.Start(); TM_NguoiHung.Start(); } }
private void newGameToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Control x in this.Controls) { if (x is PictureBox && x.Tag == "biavo") { x.Dispose(); } } pic_pau_st.Image = Properties.Resources.pause_icon; score = 0; miss = 0; StartGame1(); Btn_Click(sender, e); TM_BiaVang.Start(); TM_NguoiHung.Start(); }
private void pic_pau_st_Click(object sender, EventArgs e) { start_pau = !start_pau; if (start_pau) { audiochayGame.Stop(); pic_pau_st.Image = Properties.Resources.start_icon; TM_NguoiHung.Stop(); TM_BiaVang.Stop(); } else { audiochayGame.PlayLooping(); pic_pau_st.Image = Properties.Resources.pause_icon; TM_NguoiHung.Start(); TM_BiaVang.Start(); } }
private void TM_RanDom_Tick(object sender, EventArgs e) { int r = ran.Next(0, 4); if (r == 0) { hotro.displayPic(picb1, picb2, picb3, picb4);// hiện ảnh 1 , ẩn 3 ảnh sau } if (r == 1) { hotro.displayPic(picb2, picb1, picb3, picb4); } if (r == 2) { hotro.displayPic(picb3, picb2, picb1, picb4); } if (r == 3) { hotro.displayPic(picb4, picb2, picb3, picb1); } TM_RanDom.Stop(); TM_BiaVang.Start(); }