Form won't open anymore?

C

CAM

Hello,

I am using Visual Basic.Net 2008 I have created about 3 forms working OK in
the past, but now I doesn't work anymore. When I try to start to
run/debugging the program it starts to open the form in a second and close
quickly. I don't know why this is happening. I add a treeview control, but
I don't think that is the problem. I just don't know what I did. Any tips
will be appreciated. Thank you in advance.

Cheers.
 
C

Cor Ligthert[MVP]

Cam,

Can it be that you have inserted somewhere End instead of completely End If
or something?

It sounds like this.

Cor
 
K

kimiraikkonen

Hello,

I am using Visual Basic.Net 2008 I have created about 3 forms working OK in
the past, but now I doesn't  work anymore.  When I try to start to
run/debugging the program it starts to open the form in a second and close
quickly.  I don't know why this is happening.  I add a treeview control, but
I don't think that is the problem.  I just don't know what I did.  Any tips
will be appreciated.  Thank you in advance.

Cheers.

I recommend you to check your startup form's load event. There might
be some code that closes your form because of conditional statements,
or another program on your system may be killing your application.

Plus you can use a technique to catch close reason by putting in your
FormClosing event as follows:


Private Sub Form1_FormClosing(ByVal sender As Object, _
ByVal e As System.Windows.Forms.FormClosingEventArgs) _
Handles Me.FormClosing

' See close reason on exit
Msgbox(e.CloseReason.ToString)

End Sub


Hope this helps,

Onur G.
 
C

CAM

Thanks kimiraikkonen I will look into that I appreciated the tip.


Hello,

I am using Visual Basic.Net 2008 I have created about 3 forms working OK
in
the past, but now I doesn't work anymore. When I try to start to
run/debugging the program it starts to open the form in a second and close
quickly. I don't know why this is happening. I add a treeview control, but
I don't think that is the problem. I just don't know what I did. Any tips
will be appreciated. Thank you in advance.

Cheers.

I recommend you to check your startup form's load event. There might
be some code that closes your form because of conditional statements,
or another program on your system may be killing your application.

Plus you can use a technique to catch close reason by putting in your
FormClosing event as follows:


Private Sub Form1_FormClosing(ByVal sender As Object, _
ByVal e As System.Windows.Forms.FormClosingEventArgs) _
Handles Me.FormClosing

' See close reason on exit
Msgbox(e.CloseReason.ToString)

End Sub


Hope this helps,

Onur G.
 
J

James Hahn

Don't forget that you can start the debugger using Step Into (F8). That
enables you to trace the execution from the very first command, before the
form is shown.
 
C

CAM

Thanks James for the tip.

James Hahn said:
Don't forget that you can start the debugger using Step Into (F8). That
enables you to trace the execution from the very first command, before the
form is shown.
 

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

Top