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 WindowsFormsApplication4
- {
- public partial class Form2 : Form
- {
- public Form2()
- {
- InitializeComponent();
- }
- int islide = 0;
- private void Form2_Load(object sender, EventArgs e)
- {
- button1.Text = "START";
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- }
- private void Question1()
- {
- label1.Text = "Which has the highest mountain?";
- radioButton1.Text = "Mercury";
- radioButton2.Text = "Earth";
- radioButton3.Text = "Venus";
- radioButton4.Text = "Mars";
- }
- private void Question2()
- {
- label1.Text = " Which insect accurately indicates the air temperature?";
- radioButton1.Text = "House Fly";
- radioButton2.Text = "Cricket";
- radioButton3.Text = "Mosquito";
- radioButton4.Text = "Dragonfly";
- }
- private void Question3()
- {
- label1.Text = "How many men have walked on the moon?";
- radioButton1.Text = "5";
- radioButton2.Text = "8";
- radioButton3.Text = "14";
- radioButton4.Text = "12";
- }
- private void Question4()
- {
- label1.Text = "In which country is the world's largest McDonalds Restaurant?";
- radioButton1.Text = "China";
- radioButton2.Text = "Usa";
- radioButton3.Text = "Japan";
- radioButton4.Text = "India";
- }
- private void Question5()
- {
- label1.Text = "Who has won the FIFA world player award for 2015?";
- radioButton1.Text = " Cristiano Ronaldo";
- radioButton2.Text = "Lionel Messi";
- radioButton3.Text = "Neymar";
- radioButton4.Text = "Luis Suárez";
- }
- private void Question6()
- {
- label1.Text = "World water day is celebrated every year on -";
- radioButton1.Text = "June 23";
- radioButton2.Text = "May 15";
- radioButton3.Text = "July 21";
- radioButton4.Text = "March 22";
- }
- private void Question7()
- {
- label1.Text = "Formic acid is produced by -";
- radioButton1.Text = "White ants";
- radioButton2.Text = "Cockroaches";
- radioButton3.Text = "Red ants";
- radioButton4.Text = "Mosquitoes";
- }
- private void Question8()
- {
- label1.Text = "The most healthy edible oil for heart is";
- radioButton1.Text = "Butter oil";
- radioButton2.Text = "Olive oil";
- radioButton3.Text = "Rape-seed oil";
- radioButton4.Text = "Mustard oil";
- }
- private void Question9()
- {
- label1.Text = "Which animal kills more people than any other animal in Africa?";
- radioButton1.Text = "Tiger";
- radioButton2.Text = "Lion";
- radioButton3.Text = "Hippopotamus";
- radioButton4.Text = "Leopard";
- }
- private void Question10()
- {
- label1.Text = "Myanmar is the new name of";
- radioButton1.Text = "Thailand";
- radioButton2.Text = "Burma";
- radioButton3.Text = "Philippines";
- radioButton4.Text = "Vietnam";
- }
- private void Question11()
- {
- label1.Text = "The newest country in the world is";
- radioButton1.Text = "South Sudan";
- radioButton2.Text = "Kosovo";
- radioButton3.Text = "East Trimor";
- radioButton4.Text = "Palau";
- }
- private void Question12()
- {
- label1.Text = "Where did Industrial revolution take place?";
- radioButton1.Text = "Germany";
- radioButton2.Text = "England";
- radioButton3.Text = "France";
- radioButton4.Text = "USA";
- }
- private void Question13()
- {
- label1.Text = "The world's tallest free-standing structure is";
- radioButton1.Text = "Eiffel Tower";
- radioButton2.Text = "Leaning Tower of Pisa";
- radioButton3.Text = "CN Tower";
- radioButton4.Text = "Qutab Minar";
- }
- private void Question14()
- {
- label1.Text = "The least distance of distinct vision is";
- radioButton1.Text = "35 cm";
- radioButton2.Text = "25 cm";
- radioButton3.Text = "45 cm";
- radioButton4.Text = "15 cm";
- }
- private void Question15()
- {
- label1.Text = "Which country is the leading producer of Uranium?";
- radioButton1.Text = "Kazakhstan";
- radioButton2.Text = "Russia";
- radioButton3.Text = "France";
- radioButton4.Text = "Canada";
- }
- private void Question16()
- {
- label1.Text = "aWhich country is the leading producer of Uranium?";
- radioButton1.Text = "Kazakhstan";
- radioButton2.Text = "Russia";
- radioButton3.Text = "France";
- radioButton4.Text = "Canada";
- }
- private void radioButton3_CheckedChanged(object sender, EventArgs e)
- {
- if (button1.Text == "7" && radioButton3.Checked == true)
- {
- radioButton3.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "9" && radioButton3.Checked == true)
- {
- radioButton3.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "13" && radioButton3.Checked == true)
- {
- radioButton3.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if ((button1.Text == "1" || button1.Text == "2" || button1.Text == "3" || button1.Text == "4" || button1.Text == "5" || button1.Text == "6" || button1.Text == "11" || button1.Text == "8" || button1.Text == "15" || button1.Text == "10" || button1.Text == "12" || button1.Text == "15" && (radioButton3.Checked == true)))
- {
- //radioButton3.BackColor = Color.Red;
- this.Hide();
- Form1 form1 = new Form1();
- form1.Show();
- }
- }
- private void radioButton4_CheckedChanged(object sender, EventArgs e)
- {
- if (button1.Text == "1" && radioButton4.Checked == true)
- {
- radioButton4.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "3" && radioButton4.Checked == true)
- {
- radioButton4.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "6" && radioButton4.Checked == true)
- {
- radioButton4.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if ((button1.Text == "2" || button1.Text == "4" || button1.Text == "5" || button1.Text == "7" || button1.Text == "8" || button1.Text == "9" || button1.Text == "10" || button1.Text == "11" || button1.Text == "12" || button1.Text == "13" || button1.Text == "15" || button1.Text == "14" && (radioButton4.Checked == true)))
- {
- //radioButton4.BackColor = Color.Red;
- // my_sound.Play();
- this.Hide();
- Form1 form1 = new Form1();
- form1.Show();
- }
- }
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
- {
- if (button1.Text == "11" && radioButton1.Checked == true)
- {
- radioButton1.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "15" && radioButton1.Checked == true)
- {
- radioButton1.BackColor = Color.Green;
- button1.Enabled = true;
- MessageBox.Show("WELL DONE!!!");
- }
- if ((button1.Text == "1" || button1.Text == "2" || button1.Text == "3" || button1.Text == "4" || button1.Text == "5" || button1.Text == "6" || button1.Text == "7" || button1.Text == "8" || button1.Text == "9" || button1.Text == "10" || button1.Text == "12" || button1.Text == "13" && (radioButton1.Checked == true)))
- {
- radioButton1.BackColor = Color.Red;
- // my_sound.Play();
- this.Hide();
- Form1 form1 = new Form1();
- form1.Show();
- }
- }
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
- {
- if (button1.Text == "2" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "5" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "8" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "10" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "12" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "14" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if (button1.Text == "4" && radioButton2.Checked == true)
- {
- radioButton2.BackColor = Color.Green;
- button1.Enabled = true;
- }
- if ((button1.Text == "1" || button1.Text == "3" || button1.Text == "6" || button1.Text == "7" || button1.Text == "11" || button1.Text == "9" || button1.Text == "13" || button1.Text == "15" && (radioButton2.Checked == true)))
- {
- radioButton2.BackColor = Color.Red;
- // my_sound.Play();
- this.Hide();
- Form1 form1 = new Form1();
- form1.Show();
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- //button1.Text = "0";
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.Visible = true;
- radioButton2.Visible = true;
- radioButton3.Visible = true;
- radioButton4.Visible = true;
- islide = islide + 1;
- {
- switch (islide)
- {
- case 1:
- Question1();
- button1.Enabled = false;
- button1.Text = Convert.ToString(islide);
- // button1.ForeColor = Color.Black;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- /* radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;*/
- break;
- case 2:
- Question2();
- label3.Text = "1";
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 3:
- Question3();
- label3.Text = "2";
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 4:
- label3.Text = "3";
- Question4();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 5:
- Question5();
- label3.Text = "4";
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 6:
- label3.Text = "5";
- Question6();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 7:
- label3.Text = "6";
- Question7();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 8:
- label3.Text = "7";
- Question8();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 9:
- label3.Text = "8";
- Question9();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 10:
- label3.Text = "9";
- Question10();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 11:
- label3.Text = "10";
- Question11();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 12:
- label3.Text = "11";
- Question12();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 13:
- label3.Text = "12";
- Question13();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 14:
- label3.Text = "13";
- Question14();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- case 15:
- label3.Text = "14";
- Question15();
- button1.Text = Convert.ToString(islide);
- button1.Enabled = false;
- radioButton1.Checked = false;
- radioButton2.Checked = false;
- radioButton3.Checked = false;
- radioButton4.Checked = false;
- radioButton1.BackColor = Color.RoyalBlue;
- radioButton2.BackColor = Color.RoyalBlue;
- radioButton3.BackColor = Color.RoyalBlue;
- radioButton4.BackColor = Color.RoyalBlue;
- break;
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment