i have a multiple form project in vb.net 2003.from my main form i activate the 2nd and from 2nd 3rd and so on.but the problem is when im going back from higher 3rd to 2nd and from 2nd to first, the closing event of my mainform doesnt seem to be working. well i have it me.close but it is still in debugging mode. i could only make it stop thru the stop button.
appreciate your help... thanks
Main Form Closing Problemvb.net
Page 1 of 1
7 Replies - 5099 Views - Last Post: 16 February 2011 - 07:18 AM
Replies To: Main Form Closing Problem
#2
Re: Main Form Closing Problem
Posted 06 December 2006 - 06:02 PM
does clicking the X at the top right of the form not close the form?
#3
Re: Main Form Closing Problem
Posted 07 December 2006 - 02:47 AM
yes. its just hiding. i can make it stop only by stop debugging/
This post has been edited by cimpercee: 07 December 2006 - 02:50 AM
#4
Re: Main Form Closing Problem
Posted 07 December 2006 - 07:24 AM
the problem is that you have something that is still running.
For instance, I get the same problem if I am multi-threading and I don't end a thread, or if I have a loop that isn't stopped, etc.
For instance, I get the same problem if I am multi-threading and I don't end a thread, or if I have a loop that isn't stopped, etc.
#5
Re: Main Form Closing Problem
Posted 07 December 2006 - 02:42 PM
so i guess its because the other forms are set to .hide...so how do i end it? when i put it to close i got errors.
i have these codes for my 2nd form and 3rd closing event
form2_closing(byval sender as object,byval e as system.componentmodel.canceleventargs) handles mybase.closing
dim frm as new form1
me.hide() / <---- when i change this to close it either closes or errors. i forgot coz im not on my pc, just posting from someones'
i have these codes for my 2nd form and 3rd closing event
form2_closing(byval sender as object,byval e as system.componentmodel.canceleventargs) handles mybase.closing
dim frm as new form1
me.hide() / <---- when i change this to close it either closes or errors. i forgot coz im not on my pc, just posting from someones'
This post has been edited by cimpercee: 07 December 2006 - 03:10 PM
#6
Re: Main Form Closing Problem
Posted 07 December 2006 - 03:55 PM
Thats because you are trying to close your main form, hence the Me. Try using the name of the form that you are closing.
Or if you have created the form by instantiating it, then close it using the name that you created it under.
For example:
form2.Close()
Or if you have created the form by instantiating it, then close it using the name that you created it under.
For example:
Dim frm2 as New Form2 frm2.Close()
#7
Re: Main Form Closing Problem
Posted 16 February 2011 - 06:27 AM
Do not use Me.Close()
Use Application.Exit()
This will exit the whole program even if there are other forms that are still open or hidden.
Use Application.Exit()
This will exit the whole program even if there are other forms that are still open or hidden.
#8
Re: Main Form Closing Problem
Posted 16 February 2011 - 07:18 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote






|