[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 !
Re: Form load (Simple question)
Quote:
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.
Re: Form load (Simple question)
Are you sure the form was unloaded?
Hiding the form does not unload it.
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 !
Re: Form load (Simple question)
Another question:
Is it normal when I use this "Timer1.Enabled = True"
The load event is fired again ?
Thanks !
Re: Form load (Simple question)
Quote:
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 !
Re: Form load (Simple question)
Quote:
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...
Quote:
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.