Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Result()
- public Form1()
- {
- InitializeComponent();
- }
- int score = 0;
- int totalScore = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- Random capital = new Random();
- int index = capital.Next(1, 50);
- string[] Country = new string[]{"Abkhazia", "Afghanistan", "Armenia", "Australia", "Azerbaijan", "Bahrain"}; //just point out there is alot more countries that are not listed
- string countryName = Country[index];
- string imageFile = countryName + ".png";
- pictureBoxFlag.Image = System.Drawing.Image.FromFile(imageFile);
- buttonNext.Enabled = false;
- }
- private void buttonCheck_Click(object sender, EventArgs e)
- {
- if (txtBoxAnswer.Text == "")
- {
- MessageBox.Show("Please enter a Country");
- }
- else
- {
- txtBoxAnswer.ReadOnly = true;
- buttonCheck.Enabled = false;
- buttonNext.Enabled = true;
- }
- }
- private void buttonExit_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- private void buttonNext_Click(object sender, EventArgs e)
- {
- if (txtBoxAnswer.Text == "")
- {
- MessageBox.Show("Please enter Country");
- }
- else
- {
- txtBoxAnswer.Text = "";
- lablelResult.Text = "";
- txtBoxAnswer.ReadOnly = false;
- buttonCheck.Enabled = true;
- buttonNext.Enabled = false;
- }
- }
- private void Result()
- {
- if (txtBoxAnswer.Text.ToLower() == Country[index].ToLower())
- {
- lablelResult.Text = "You are Right!";
- score = 10;
- totalScore = totalScore + score;
- labelScore.Text = ("score is: " + score + "nTotal score is: " +totalScore);
- }
- else
- {
- lablelResult.Text = "You are Wrong! Correct answer is" + Country[index];
- score = -10;
- totalScore = (totalScore + score);
- labelScore.Text = ("score is: " + score + "nTotal score is: " + totalScore);
- }
- }
- int score = 0;
- int totalScore = 0;
- private void Form1_Load(object sender, EventArgs e)
- {
- Random capital = new Random();
- int index = capital.Next(1, 50);
- string[] Country = new string[]{"Abkhazia", "Afghanistan", "Armenia", "Australia", "Azerbaijan", "Bahrain"}; //just point out there is alot more countries that are not listed
- string countryName = Country[index];
- string imageFile = countryName + ".png";
- pictureBoxFlag.Image = System.Drawing.Image.FromFile(imageFile);
- buttonNext.Enabled = false;
- }
- private int score = 0;
- private int totalScore = 0;
- private int index = 0;
- private string[] Country = new string[]{"Abkhazia", "Afghanistan", "Armenia", "Australia", "Azerbaijan", "Bahrain"}; //just point out there is alot more countries that are not listed
- private void Form1_Load(object sender, EventArgs e)
- {
- Random capital = new Random();
- index = capital.Next(1, 50);
- string countryName = Country[index];
- string imageFile = countryName + ".png";
- pictureBoxFlag.Image = System.Drawing.Image.FromFile(imageFile);
- buttonNext.Enabled = false;
- }
Add Comment
Please, Sign In to add comment