S
Sherwood Page
Greetings,
I have a "newbie" question related to forms. I have the following code
in which I display a second form when a button on the first form is
pressed (using the "Click" event).
private void btnClickMe_Click(object sender, System.EventArgs e)
{
ActiveForm.Hide();
frmInstructions frmInstructions = new frmInstructions();
frmInstructions.Show();
}
What I have noticed, however, is that I am still in "run" mode when the
code finishes executing. I thought the reason might be due to the fact
that I never closed the first form, I just hid it.
However, when I add the line of code, "ActiveForm.Close();" after
"frmInstructions.Show();", I have noticed that the second dialog never
even displays. Is there something obvious I am doing wrong?
[Note: I have also placed the following code in the "Click" event of the
command button on the second form, but I receive an error on that line
of code: "frmMain.ActiveForm.Close();"].
Thanks in advance!
I have a "newbie" question related to forms. I have the following code
in which I display a second form when a button on the first form is
pressed (using the "Click" event).
private void btnClickMe_Click(object sender, System.EventArgs e)
{
ActiveForm.Hide();
frmInstructions frmInstructions = new frmInstructions();
frmInstructions.Show();
}
What I have noticed, however, is that I am still in "run" mode when the
code finishes executing. I thought the reason might be due to the fact
that I never closed the first form, I just hid it.
However, when I add the line of code, "ActiveForm.Close();" after
"frmInstructions.Show();", I have noticed that the second dialog never
even displays. Is there something obvious I am doing wrong?
[Note: I have also placed the following code in the "Click" event of the
command button on the second form, but I receive an error on that line
of code: "frmMain.ActiveForm.Close();"].
Thanks in advance!