|
-
Dec 12th, 2006, 09:05 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Form load (Simple question)
Hi everybody !
In the Load_Event of a Form I put on the 1st line a Msgbox "Hello"
I call the form (form.show 1) and the message box appears...
Is there many reasons why when I call the form for a second time, the Msgbox did not appear ?
The only reason I know, it's probably because it was not correctly Unload...
Is there a way to verify if the Form was unload ???
Thanks in advance !
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Dec 12th, 2006, 09:17 AM
#2
Hyperactive Member
Re: Form load (Simple question)
 Originally Posted by DubweiserTM
Is there a way to verify if the Form was unload ???
Thanks in advance !
Try to put a MsgBox in different events like Teminate, Unload and so on and see in which order they are fired or fired at all.
-
Dec 12th, 2006, 09:26 AM
#3
Re: Form load (Simple question)
Are you sure the form was unloaded?
Hiding the form does not unload it.
-
Dec 12th, 2006, 09:32 AM
#4
Thread Starter
Hyperactive Member
Re: Form load (Simple question)
Yeah I unload the form, but I found the problem...
I add an Unload me in the Timer1_Timer() and its okay !
Last edited by DubweiserTM; Dec 12th, 2006 at 10:00 AM.
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Dec 12th, 2006, 10:01 AM
#5
Thread Starter
Hyperactive Member
Re: Form load (Simple question)
Another question:
Is it normal when I use this "Timer1.Enabled = True"
The load event is fired again ?
Thanks !
Last edited by DubweiserTM; Dec 12th, 2006 at 11:16 AM.
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Dec 12th, 2006, 11:17 AM
#6
Thread Starter
Hyperactive Member
Re: Form load (Simple question)
 Originally Posted by DubweiserTM
Is it normal when I use this "Timer1.Enabled = True"
The load event is fired again ?
Is someone has an idea ?
Thanks !
DubweiserTM

If your question has been answered, you can mark a thread as resolved...
-
Dec 12th, 2006, 12:10 PM
#7
Re: Form load (Simple question)
 Originally Posted by DubweiserTM
Is there a way to verify if the Form was unload ???
Yes, by looping through the Forms collection:
VB Code:
Dim f As Form
For Each f In Forms
If f.Name = "Form1" Then
'it is loaded...
Exit Sub
End If
Next
'it is not loaded...
 Originally Posted by DubweiserTM
Is it normal when I use this "Timer1.Enabled = True"...
Quite. Accessing any control on a certain Form envokes this Form (if it's not loaded yet) and loads it. Thus the Form_Load event is fired.
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
|