Z
Z.K.
I started a forms application and I put on the form three buttons. In
the functions for the radio buttons I put in a single messagebox like:
MessageBox("Hello 1")
MessageBox("Hello 2")
MessageBox("Hello 3")
The first radio button works fine and displays "Hello 1". The other
ones do not work as I expected though and I am not sure why. When I
click on the second radio button, I get Hello1 and after clicking okay I
get Hello 2. The same for the third radio button though it starts with
radio 2 and then radio 3. This is my first experience with the new .NET
forms application and I would have expected it to act somewhat like a
radio button in MFC which only displays that MessageBox in the radio
button that was selected.
These are the functions that the design application created for me and I
only added the MessageBox statements.
private: System:: Void radioButton1_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 1");
}
private: System:: Void radioButton2_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 2");
}
private: System:: Void radioButton3_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 3");
}
Can someone tell me what I am doing wrong? Also, I was wondering why
visual studio puts the functions for the form in the forms.h file
instead of in a *.cpp file.
Z.K.
the functions for the radio buttons I put in a single messagebox like:
MessageBox("Hello 1")
MessageBox("Hello 2")
MessageBox("Hello 3")
The first radio button works fine and displays "Hello 1". The other
ones do not work as I expected though and I am not sure why. When I
click on the second radio button, I get Hello1 and after clicking okay I
get Hello 2. The same for the third radio button though it starts with
radio 2 and then radio 3. This is my first experience with the new .NET
forms application and I would have expected it to act somewhat like a
radio button in MFC which only displays that MessageBox in the radio
button that was selected.
These are the functions that the design application created for me and I
only added the MessageBox statements.
private: System:: Void radioButton1_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 1");
}
private: System:: Void radioButton2_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 2");
}
private: System:: Void radioButton3_CheckedChanged(System:: Object^
sender, System::EventArgs^ e)
{
MessageBox:: Show("Hello 3");
}
Can someone tell me what I am doing wrong? Also, I was wondering why
visual studio puts the functions for the form in the forms.h file
instead of in a *.cpp file.
Z.K.