private void GameOver() { MessageBox.Show("Thua rồi nhé hihi, chơi lại nào", "GameOver"); game.AllOver(); ShowDuplicated(); game = new ConnectionGame(); foreach (Control x in this.Controls) { if (x is TextBox) { ((TextBox)x).Text = ""; } else if (x is PictureBox) { ((PictureBox)x).Image = null; x.Visible = true; } else if (x is RichTextBox) { ((RichTextBox)x).Text = ""; } } this.rtbNPC1.Text = game.Init(); richTextBox1.Text = this.rtbNPC1.Text + "\n"; this.rtbDecription.Text = game.Decription(this.rtbNPC1.Text); pbWord.InitialImage = null; this.pbWord.LoadAsync(game.getLinkPic(this.rtbNPC1.Text)); this.lbSeq.Text = this.rtbNPC1.Text.Substring(this.rtbNPC1.Text.Length - 2); }
public GWordConnection() { InitializeComponent(); this.pbWord.SizeMode = PictureBoxSizeMode.Zoom; this.rtbNPC1.Text = game.Init(); richTextBox1.Text = this.rtbNPC1.Text + "\n"; this.rtbDecription.Text = game.Decription(this.rtbNPC1.Text); pbWord.InitialImage = null; this.pbWord.LoadAsync(game.getLinkPic(this.rtbNPC1.Text)); this.lbSeq.Text = this.rtbNPC1.Text.Substring(this.rtbNPC1.Text.Length - 2); Control.CheckForIllegalCrossThreadCalls = false; }
private void GameOver1() { DialogResult dialogResult = MessageBox.Show("Your are playing, Sure to leave??", "Message", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.Yes) { } else if (dialogResult == DialogResult.No) { return; } game.AllOver(); ShowDuplicated(); game = new ConnectionGame(); foreach (Control x in this.Controls) { if (x is TextBox) { ((TextBox)x).Text = ""; } else if (x is PictureBox) { ((PictureBox)x).Image = null; x.Visible = true; } else if (x is RichTextBox) { ((RichTextBox)x).Text = ""; } } this.lbScore.Text = "Score: " + 0; this.rtbNPC1.Text = game.Init(); richTextBox1.Text = this.rtbNPC1.Text + "\n"; this.rtbDecription.Text = game.Decription(this.rtbNPC1.Text); pbWord.InitialImage = null; this.pbWord.LoadAsync(game.getLinkPic(this.rtbNPC1.Text)); this.lbSeq.Text = this.rtbNPC1.Text.Substring(this.rtbNPC1.Text.Length - 2); }