Pavle_nis

C++ Quiz Form11

Oct 19th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.84 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 Form11 : Form
  14.     {
  15.         public Form11()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void button1_Click(object sender, EventArgs e)
  21.         {
  22.             this.Visible = true;
  23.             Form2 form2 = new Form2();
  24.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  25.             if (dialog == DialogResult.Yes)
  26.             {
  27.                 this.Visible = false;
  28.                 form2.Show();
  29.             }
  30.             else if (dialog == DialogResult.No)
  31.             {
  32.                 //e.Cancel = true;
  33.                 Application.Exit();
  34.             }
  35.         }
  36.  
  37.         private void button2_Click(object sender, EventArgs e)
  38.         {
  39.  
  40.             DialogResult dialog = MessageBox.Show("Answer is correct! You have successfully completed quiz! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  41.             if (dialog == DialogResult.Yes)
  42.             {
  43.                 this.Visible = false;
  44.                 Form2 form2 = new Form2();
  45.                 form2.Show();
  46.             }
  47.             else if (dialog == DialogResult.No)
  48.             {
  49.                 //e.Cancel = true;
  50.                 Application.Exit();
  51.             }
  52.         }
  53.  
  54.         private void button3_Click(object sender, EventArgs e)
  55.         {
  56.             this.Visible = true;
  57.             Form2 form2 = new Form2();
  58.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  59.             if (dialog == DialogResult.Yes)
  60.             {
  61.                 this.Visible = false;
  62.                 form2.Show();
  63.             }
  64.             else if (dialog == DialogResult.No)
  65.             {
  66.                 //e.Cancel = true;
  67.                 Application.Exit();
  68.             }
  69.         }
  70.  
  71.         private void button4_Click(object sender, EventArgs e)
  72.         {
  73.             this.Visible = true;
  74.             Form2 form2 = new Form2();
  75.             DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
  76.             if (dialog == DialogResult.Yes)
  77.             {
  78.                 this.Visible = false;
  79.                 form2.Show();
  80.             }
  81.             else if (dialog == DialogResult.No)
  82.             {
  83.                 //e.Cancel = true;
  84.                 Application.Exit();
  85.             }
  86.         }
  87.     }
  88. }
Add Comment
Please, Sign In to add comment