7 Replies - 6027 Views - Last Post: 16 February 2011 - 07:18 AM Rate Topic: -----

#1 cimpercee  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 127
  • Joined: 10-August 06

Main Form Closing Problem

Posted 06 December 2006 - 05:44 PM

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
Is This A Good Question/Topic? 0
  • +

Replies To: Main Form Closing Problem

#2 Mach1Guy  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 89
  • Joined: 04-December 06

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?
Was This Post Helpful? 0
  • +
  • -

#3 cimpercee  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 127
  • Joined: 10-August 06

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

Was This Post Helpful? 0
  • +
  • -

#4 the_hangman  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 14
  • View blog
  • Posts: 602
  • Joined: 18-January 06

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.
Was This Post Helpful? 0
  • +
  • -

#5 cimpercee  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 127
  • Joined: 10-August 06

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'

This post has been edited by cimpercee: 07 December 2006 - 03:10 PM

Was This Post Helpful? 0
  • +
  • -

#6 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

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.
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()


Was This Post Helpful? 0
  • +
  • -

#7 November-06  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 407
  • Joined: 04-January 11

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.
Was This Post Helpful? 0
  • +
  • -

#8 qtex  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 142
  • Joined: 24-October 09

Re: Main Form Closing Problem

Posted 16 February 2011 - 07:18 AM

View PostNovember-06, on 16 February 2011 - 06:27 AM, said:

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.


"end" works well also, it will close whole application too.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1