Advertisement
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.Windows.Forms;
- namespace Project
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void label1_Click(object sender, EventArgs e)
- {
- }
- string questão1 = "Capital de Portugal?";
- string resposta1 = "Porto";
- string resposta2 = "Lisboa";
- string resposta3 = "Braga";
- string resposta4 = "Viana do Castelo";
- int respostaCorrecta = 2;
- string topico1 = "Geografia";
- int dificuldade1 = 1; // 1 é mais facil, 3 é mais dificil
- private void Form1_Load(object sender, EventArgs e)
- {
- QuestionLbl.Text = questão1;
- Answer1.Text = resposta1;
- Answer2.Text = resposta2;
- Answer3.Text = resposta3;
- Answer4.Text = resposta4;
- // MessageBox.Show("Acabei de carregar");
- }
- private void button1_Click(object sender, EventArgs e)
- {
- int resultado = 0;
- if (Answer1.Checked)
- {
- resultado = 1;
- }
- else if (Answer2.Checked)
- {
- resultado = 2;
- }
- else if (Answer3.Checked)
- {
- resultado = 3;
- }
- else if (Answer4.Checked)
- {
- resultado = 4;
- //MessageBox.Show("Seleccionei 4ªopção);
- }
- if (resultado == respostaCorrecta)
- {
- MessageBox.Show("Acertou!");
- }
- else
- {
- MessageBox.Show("Errou!");
- }
- MessageBox.Show(resultado.ToString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement