Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6.0 On XP - Application hangs on form close

Status
Not open for further replies.

hoppingbunny

Programmer
Aug 28, 2002
2
US

I am using VB 6.0 service pack 5. I was adding a new form to an existing application. I created the new form with two labels, a text box, two option boxes, and a command button. There was no code for the form other than three public properties I defined. I ran the application within the development environment. From a pop-up menu on my main form, I selected the option that shows the new form (in modal mode). The new form displayed. I then attempt to close the new form by pressing on the X in the upper hand corner. The form disappeared, the hour glass appeared, and the application hung. I had to kill the application, which also kills the development environment. I tried to reproduce the situation and was unable to do so.

I have ran into similar problems while I have been modifying this application. Sometimes when I close the main form by pressing the X in the upper hand corner the application hangs. (Note, I am always running from the Visual Studio develop. environment).

Any ideas on what the problem might be? Is it an XP issue? Visual Studio Issue? Application issue? (I'm new to VB).
 
I have win98SE and I have experienced the same problem. I also have VB 6.0 SP5... I think i fixed the problem though...

I had a form that a user input data onto and then hit a generate report button that loaded a status screen with a cancel button. When they clicked cancel, I would unload the status screen and then reload the screen they came from. When I clicked on the X to close that screen, it would do what you were talking about. I *think* that was the problem. I'm gonna look at the code real quick to figure out what I did to fix it.
 
I believe I added code to set the form to nothing (Set frmForm = Nothing) on the Form_Unload event. I'll keep looking to see if I did anything else.
 
Also, when you close this new form, do you want to go back to the old form?? If not, then in the code behind the button that leads you to the new form, you need to add:

Unload frmFirstForm

before you open the new form... so that it isn't still loaded while the new form is up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top