GUI Buttons = Program crashing / New Member
Jul 4, 2012 at 4:33pm UTC
So I'm basically creating a quiz and when you click on either button1, button2, or button3, textbox1 will change the question, but the problem is that textBox1 (question box) does not change the question, but the buttons' text changes (which they're supposed to do). Any help on trying to solve this? There are no errors in the program, but after running the program and clicking enter or any other character in the "question box" the entire program crashes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
#pragma once
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
namespace FP {
private : System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) { //question label
}
private : System::Void textBox1_TextChanged(System::Object^ sender, System::EventArgs^ e) { //question box - textBox1
textBox1 -> Text = "Question 1" ;
button1 -> Text = "Samsung" ;
button2 -> Text = "Motorola" ;
button3 -> Text = "Apple" ;
}
private : System::Void label2_Click(System::Object^ sender, System::EventArgs^ e) { //your answer label
}
private : System::Void textBox2_TextChanged(System::Object^ sender, System::EventArgs^ e) { //your answer box - textBox2
}
private : System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { //choice 1 button
}
private : System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { //choice 2 button
textBox1 -> Text = "Question 2" ;
button1 -> Text = "Apple" ;
correct += 4;
textBox3 -> Text = correct.ToString();
button2 -> Text = "Samsung" ;
button3 -> Text = "HTC" ;
}
}
private : System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { //choice 3 button
}
private : System::Void label3_Click(System::Object^ sender, System::EventArgs^ e) { //current score label
}
private : System::Void textBox3_TextChanged(System::Object^ sender, System::EventArgs^ e) { //current score box - textBox3
}
};
}
Last edited on Jul 4, 2012 at 6:31pm UTC
Jul 4, 2012 at 6:43pm UTC
its obvious, you suck!
Topic archived. No new replies allowed.