Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication3
- {
- public partial class Form2 : Form
- {
- int m, s;
- public Form2()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- // MessageBox.Show("Answer is not correct");
- this.Visible = true;
- Form2 form2 = new Form2();
- DialogResult dialog =MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- if(dialog == DialogResult.Yes)
- {
- this.Visible = false;
- form2.Show();
- }
- else if(dialog == DialogResult.No)
- {
- //e.Cancel = true;
- Application.Exit();
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- // MessageBox.Show("Answer is correct");
- button2.BackColor = Color.Green;
- this.Visible = false;
- Form3 form3 = new Form3();
- form3.Show();
- }
- private void button3_Click(object sender, EventArgs e)
- {
- this.Visible = true;
- Form2 form2 = new Form2();
- DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- if (dialog == DialogResult.Yes)
- {
- this.Visible = false;
- form2.Show();
- }
- else if (dialog == DialogResult.No)
- {
- //e.Cancel = true;
- Application.Exit();
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- this.Visible = true;
- Form2 form2 = new Form2();
- DialogResult dialog = MessageBox.Show("Answer is not correct! Do you want to play again?", "Quiz", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- if (dialog == DialogResult.Yes)
- {
- this.Visible = false;
- form2.Show();
- }
- else if (dialog == DialogResult.No)
- {
- //e.Cancel = true;
- Application.Exit();
- }
- }
- private void button5_Click(object sender, EventArgs e)
- {
- MessageBox.Show("Answer is private");
- this.Visible = false;
- Form3 form3 = new Form3();
- form3.Show();
- }
- private void button6_Click(object sender, EventArgs e)
- {
- button3.Enabled = false;
- button4.Enabled = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment