O
OutdoorGuy
Greetings,
I have a "newbie" question related to forms. I am attempting to use the
code below to open up another form when the user presses the "OK" button
(after making the appropriate selection from a combo box). However, I
am receiving an error at the following line of code:
TestNumber.ActiveForm.Show();
"TestNumber" is the name of the second form that I want to display. The
code for this routine is below:
private void btnOK_Click(object sender, System.EventArgs e)
{
string strChoice = this.cboChoice.Text;
switch (strChoice)
{
case "For Loop":
TestNumber.ActiveForm.Show(); <-- Error occurs here
break;
case "While Loop":
...
break;
}
}
Any ideas as to what I am doing wrong?
Thanks in advance!
I have a "newbie" question related to forms. I am attempting to use the
code below to open up another form when the user presses the "OK" button
(after making the appropriate selection from a combo box). However, I
am receiving an error at the following line of code:
TestNumber.ActiveForm.Show();
"TestNumber" is the name of the second form that I want to display. The
code for this routine is below:
private void btnOK_Click(object sender, System.EventArgs e)
{
string strChoice = this.cboChoice.Text;
switch (strChoice)
{
case "For Loop":
TestNumber.ActiveForm.Show(); <-- Error occurs here
break;
case "While Loop":
...
break;
}
}
Any ideas as to what I am doing wrong?
Thanks in advance!