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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wont unload!

Status
Not open for further replies.

jmswe

Programmer
Feb 14, 2002
31
GB
During this loop

Dim i
shouldstop = False
For i = 0 To sec
DoEvents
If shouldstop = True Then
Settings_Click (1)
End
Exit Function
End If
Sleep 1000
Text1.Text = "Väntar " & sec - i
Next

the cmdquit and cmdclose events wont fire when clicking close. The form is closed yes. But the program is not unloaded from memory. This behaviour only exist during this loop.

What to do?
 

Set a variable and check it in the loop to see if you should exit the loop.

Good Luck

 
I'll bet you have other loaded forms that are minimized or hidden... or maybe even just plain open.
 
This is copied and pasted to you from my MDIMain form application.

Private Sub MDIForm_Unload()
Dim i As Integer
' Loop through the forms collection and unload
' each form.
For i = 0 To Forms.Count - 1
Unload Forms(i)
Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top