|
-
Mar 18th, 2007, 08:19 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] How do i shut down all proesses in my form and unload it?
My project has one form "form1" I'm using "unload me" to shut it down but there some proesses that keep run? Is "unload me" the right way to go?
Live life to the fullest!!
-
Mar 18th, 2007, 08:38 PM
#2
Lively Member
Re: How do i shut down all proesses in my form and unload it?
Hello. If you mean loops, that don't end you should use boolean in insert it inside loop. For example when exit button is pushed, set this boolean to true and inside loop Do while .......(your statement) OR boolean = true. Sometimes there's a need to put it in many places, in this case breakpoints really help. If you don't have other chioce use End instead of Unload Me. This is the hard way to do it. Best regards
-
Mar 18th, 2007, 09:32 PM
#3
Re: How do i shut down all proesses in my form and unload it?
end = memory leaks <--- try to avoid it, it's like ending a process from the task manager. As djklocek says; a module level boolean is the way to go... Do until ThingyFinished Or StopAllLoopsNow (=True)
One Boolean can serve all loops, it's not hard to implement.
-
Mar 18th, 2007, 10:00 PM
#4
Re: How do i shut down all proesses in my form and unload it?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 18th, 2007, 10:11 PM
#5
Re: How do i shut down all proesses in my form and unload it?
The boolean in the loop is a good suggestion. I usually create a separate sub in a module to end the program, ie:
vb Code:
Public Sub EndProgram
'First destroy any public objects
'Unload forms
'In each form_unload make sure they stop all loops/timers, and destroy all objects.
Dim objForm As Form
For each objForm in Forms
Unload objForm
Next
set objForm = Nothing
End Sub
-
Mar 18th, 2007, 10:49 PM
#6
Re: How do i shut down all proesses in my form and unload it?
But she is only using a single form - Form1
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 19th, 2007, 12:20 PM
#7
Thread Starter
Fanatic Member
Re: How do i shut down all proesses in my form and unload it?
Found It , It Was A Timmer. Thank You All
Live life to the fullest!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|