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 Interatividade { public partial class Form1 : Form { List Perguntas = new List(); List Respostas = new List(); string resp = ""; int index = 0; int index2 = 0; public Form1() { InitializeComponent(); Perguntas.Add("what's your name ?"); Perguntas.Add("how are youá ?"); Perguntas.Add("How old are you ?"); button1.Text = "Start Program"; resposta.Text = "\n \n press the button below to start"; pergunta.Text = "Press the button below to start!"; pergunta.Enabled = false; user.Enabled = false; resposta.Enabled = false; bt1.Enabled = false; } private void button1_Click(object sender, EventArgs e) { resposta.Text = ""; pergunta.Text = ""; button1.Text = "Go to the next..."; pergunta.Text = Perguntas[index]; user.Text = ""; button1.Enabled = false; bt1.Enabled = true; pergunta.Enabled = true; user.Enabled = true; resposta.Enabled = true; index++; } private void bt1_Click(object sender, EventArgs e) { if (user.Text != "") { resp = user.Text; Respostas.Add("hmmm " + resp + " Ok"); Respostas.Add("hmmm " + resp + " é ? OK!"); Respostas.Add("OH " + resp + " é ? hmm"); resposta.Text = Respostas[index2]; index2++; button1.Enabled = true; } else { MessageBox.Show("Write Something", "Error 404", MessageBoxButtons.OK, MessageBoxIcon.Information); } } private void Form1_Load(object sender, EventArgs e) { } } }