473,473 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how unload all forms at the same time

yoda
291 Contributor
how unload all forms at the same time or hide all at the same time

thanks for the for who ever does

Yoda (canada eh)
Jan 8 '07 #1
5 1437
willakawill
1,646 Top Contributor
how unload all forms at the same time or hide all at the same time

thanks for the for who ever does

Yoda (canada eh)
loop through the forms
for each form in forms
form.unload
next form
Jan 8 '07 #2
Killer42
8,435 Recognized Expert Expert
how unload all forms at the same time or hide all at the same time
Not sure whether this is what you want, but the End statement will unload all forms and end the program.
Jan 8 '07 #3
sashi
1,754 Recognized Expert Top Contributor
Hi there,

Use the code below to unload all form except the current active form. hope it helps. Good luck & Take care.

Expand|Select|Wrap|Line Numbers
  1. 'Within a form module
  2.  
  3. Private Sub Form_Activate()
  4.  
  5. 'Form_Activate is a logical place to do this
  6.  
  7. Dim oFrm As Form
  8.  
  9. For Each oFrm In Forms
  10.   if oFrm.Name <> me.Name and Not _
  11.     (TypeOf oFrm Is MDIForm) then Unload oFrm
  12. Next
  13.  
  14. End Sub
  15.  
  16. 'OR: As a function in a .Bas or .cls module
  17. 'use the name of form you don't want unloaded as parameter
  18.  
  19. Public UnloadAllExceptOne(FormToStay as String)
  20.  
  21. dim oFrm as Form
  22.  
  23. for each oFrm in Forms
  24.     if oFrm.Name <> FormToStay and Not _
  25.              (TypeOf oFrm Is MDIForm) then unload oFrm
  26. next
  27.  
  28. End Sub
  29.  
Jan 8 '07 #4
yoda
291 Contributor
thanks thats all i needed guys, sorry i found it out my self last night but i will try
your codes

thanks alot Yoda Canada Eh
Jan 8 '07 #5
Wielebny
1 New Member
it would be really nice if You shared with us what You found out
Jan 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Harry J. Smith | last post by:
I have written a Visual Basic program that does a long calculation and writes the results to disk as it runs. If I click the Close button the window closes but the program keeps running. How can I...
1
by: salo | last post by:
hi at visual basic 6 i write this to the button1_cl1ck unload form1 form2.show
2
by: Lauren Hines | last post by:
Hello, I have read numerous post stating that the only way to unload an assembly (DLL in my case) is to create a separate AppDomain, load the assembly, then unload it by calling AppDomain.Unload....
2
by: brianbender | last post by:
I am trying to load and unload assemblies dynamically and call methods and properties when loaded into an Appdomain I can load assemblies all day in the current AppDomain without references and...
1
by: hal | last post by:
I have an application that includes an activex component that consumes resources that must be released when the a page is unloaded. Toward this end I subscribe to the unload event of the body...
1
by: Hal | last post by:
My most sincere gratitude to anyone who can help me work around this! I have work that needs to be done in javascript on the client whenever a page is unloaded. To this end, I subscribe to...
4
by: Brett Baisley | last post by:
I am used to VB6 where frmMain.unload, frmNew.load worked. What replaced this in vb.net?
3
lotus18
by: lotus18 | last post by:
How to cancel the unload event of a form? I have this code in vb 6 and it is working: Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("Are you sure you...
11
by: Stevo | last post by:
I've been using the unload event for a long time. I have this code, which I've abstracted and made into a stripped down simple test case below, and it works fine on the major browsers (IE5+,...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.