Form Closing on its own

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

OK, this is bizarre. I have used this method many times before and it
never did this. The code is:

Dim myFrm as New Form1
myFrm.ShowDialog()

Normally, this opens the form and freezes the calling one until myFrm
closes. However, not any more. The form opens. I interact with it and
then it goes off on a long process. When finished, it closes itself and
the previous form becomes active again.

What on earth is wrong?? Thanks!
 
Daniel said:
OK, this is bizarre. I have used this method many times before and
it never did this. The code is:

Dim myFrm as New Form1
myFrm.ShowDialog()

Normally, this opens the form and freezes the calling one until myFrm
closes. However, not any more. The form opens. I interact with it
and then it goes off on a long process. When finished, it closes itself
and the previous form becomes active again.

What on earth is wrong?? Thanks!

Maybe you set the dialogresult property of the button starting the long
running process?
To find out the cuase: Set a breakpoint in the Form's Closed event and, when
it's reached, have a look at the callstack.

Armin
 
Daniel said:
OK, this is bizarre. I have used this method many times before and it
never did this. The code is:

Dim myFrm as New Form1
myFrm.ShowDialog()

Normally, this opens the form and freezes the calling one until myFrm
closes. However, not any more. The form opens. I interact with it and
then it goes off on a long process.

Can cou describe the "long process" in more detail?
 
Armin said:
Maybe you set the dialogresult property of the button starting the long
running process?
To find out the cuase: Set a breakpoint in the Form's Closed event and,
when it's reached, have a look at the callstack.

Armin

Thanks, that was it! it was set to cancel. No idea when i set it
though. Thaaaaaaaannnnnkkkkkssssssss!!!!!!
 

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