Pavle_nis

C++ Quiz Form8

Oct 19th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.65 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace WindowsFormsApplication3
  12. {
  13.     public partial class Form8 : Form
  14.     {
  15.         public Form8()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             this.Visible = false;
  23.             Form9 form9 = new Form9();
  24.             form9.Show();
  25.         }
  26.  
  27.         private void button2_Click(object sender, EventArgs e)
  28.         {
  29.             this.Visible = true;
  30.             Form2 form2 = new Form2();
  31.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  32.             if (dialog == DialogResult.Yes)
  33.             {
  34.                 this.Visible = false;
  35.                 form2.Show();
  36.             }
  37.             else if (dialog == DialogResult.No)
  38.             {
  39.                 //e.Cancel = true;
  40.                 Application.Exit();
  41.             }
  42.         }
  43.  
  44.         private void button3_Click(object sender, EventArgs e)
  45.         {
  46.             this.Visible = true;
  47.             Form2 form2 = new Form2();
  48.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  49.             if (dialog == DialogResult.Yes)
  50.             {
  51.                 this.Visible = false;
  52.                 form2.Show();
  53.             }
  54.             else if (dialog == DialogResult.No)
  55.             {
  56.                 //e.Cancel = true;
  57.                 Application.Exit();
  58.             }
  59.         }
  60.  
  61.         private void button4_Click(object sender, EventArgs e)
  62.         {
  63.             this.Visible = true;
  64.             Form2 form2 = new Form2();
  65.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  66.             if (dialog == DialogResult.Yes)
  67.             {
  68.                 this.Visible = false;
  69.                 form2.Show();
  70.             }
  71.             else if (dialog == DialogResult.No)
  72.             {
  73.                 //e.Cancel = true;
  74.                 Application.Exit();
  75.             }
  76.         }
  77.  
  78.         private void button5_Click(object sender, EventArgs e)
  79.         {
  80.             MessageBox.Show("Answer is all the above");
  81.             this.Visible = false;
  82.             Form9 form9 = new Form9();
  83.             form9.Show();
  84.         }
  85.     }
  86. }
Add Comment
Please, Sign In to add comment