Y
Yash
Hi,
I am trying to create a sort of a wizard, that has 3
different screens in succession. The first screen is a
Form, with a Next button. In the onClick handler for this
button, I have closed the Form, set its visible property
to False and opened the next form:
Me.Close()
Me.Visible = False
m_NextForm.ShowDialog()
The next Form opens when I click on the Next button and
the first form disappears.
The second Form has a Back button which when cliked,
should show the first form and close the second form:
Me.Close()
Me.Visible = False
m_PrevForm.ShowDialog()
However, when I click the button, the following exception
is thrown:
An unhandled exception of
type 'System.InvalidOperationException' occurred in
system.windows.forms.dll
Additional information: Forms that are already displayed
modally cannot be displayed as a modal dialog. Close the
form before calling showDialog.
My question is, why does it ask for the Form to be closed
first, even though it has already been closed?
Can someone suggest a solution?
Thanks
Yash
I am trying to create a sort of a wizard, that has 3
different screens in succession. The first screen is a
Form, with a Next button. In the onClick handler for this
button, I have closed the Form, set its visible property
to False and opened the next form:
Me.Close()
Me.Visible = False
m_NextForm.ShowDialog()
The next Form opens when I click on the Next button and
the first form disappears.
The second Form has a Back button which when cliked,
should show the first form and close the second form:
Me.Close()
Me.Visible = False
m_PrevForm.ShowDialog()
However, when I click the button, the following exception
is thrown:
An unhandled exception of
type 'System.InvalidOperationException' occurred in
system.windows.forms.dll
Additional information: Forms that are already displayed
modally cannot be displayed as a modal dialog. Close the
form before calling showDialog.
My question is, why does it ask for the Form to be closed
first, even though it has already been closed?
Can someone suggest a solution?
Thanks
Yash