public void msg_fail(object sender, EventArgs e) { if (fail_cnt == 0) { word.Text = hw.Name; DialogResult result; MessageBoxButtons mbb = MessageBoxButtons.YesNo; result = MessageBox.Show("game over :( \nyou went to play new game ?", " Error Detected in Input", mbb); if (result == System.Windows.Forms.DialogResult.Yes) { if (twoplayer == false) { this.Form1_Load(sender, e); } else { secondplayer f = new secondplayer(); f.IntValue = IntValue; f.FormClosed += new FormClosedEventHandler(delegate { Close(); }); f.Show(); this.Hide(); } } if (result == System.Windows.Forms.DialogResult.No) { this.Close(); } } }
private void button4_Click(object sender, EventArgs e) { if (radioButton1.Checked == true) { Form1 f = new Form1(); f.FormClosed += new FormClosedEventHandler(delegate { Close(); }); f.IntValue = cnt; f.twoplayer = false; f.Show(); this.Hide(); } if (radioButton2.Checked == true) { secondplayer f = new secondplayer(); f.FormClosed += new FormClosedEventHandler(delegate { Close(); }); f.IntValue = cnt; f.Show(); this.Hide(); } }