Problem displaying a new form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to display a new form (named as launchPuzzle2) to the user and I use
the following code : Dim nextStep As New launchPuzzle2

In an event handler where I want the window to appear, I write the following
code : nextStep.ShowDialog()

When I place the former code in the declaration part of the program and
start the program, Visual Studio seems to have entered debugging mode but the
program window never shows up. After a while a Just-in-Time debugging window
appears, telling me that a System.StackOverflowException was encountered and
prompted me to choose a program to debug the program.

Then I move that code to the line just before the latter line of code
appears and start the program again. So it becomes:

Dim nextStep As New launchPuzzle2
nextStep.ShowDialog()

This time the program window loads. Yet when I have reached the event
handler where the above code is located, the program stopped responding. Even
the Stop Debugging button in VS does not work - I have to use Task Manager to
terminate the program.

How can I fix this? Thanks.
 
There's probably something wrong in your launchPuzzle2 constructor/code
because the program crashes when you try to load the launchPuzzle2 form, so
maybe you could post some code.

Greetz Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top