Results 1 to 7 of 7

Thread: [RESOLVED] Form load (Simple question)

  1. #1

    Thread Starter
    Hyperactive Member DubweiserTM's Avatar
    Join Date
    Dec 2005
    Location
    St-Ferdinand, Québec
    Posts
    427

    Resolved [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...

  2. #2
    Hyperactive Member
    Join Date
    Dec 2006
    Location
    Jar, Norway
    Posts
    372

    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.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Form load (Simple question)

    Are you sure the form was unloaded?

    Hiding the form does not unload it.

  4. #4

    Thread Starter
    Hyperactive Member DubweiserTM's Avatar
    Join Date
    Dec 2005
    Location
    St-Ferdinand, Québec
    Posts
    427

    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...

  5. #5

    Thread Starter
    Hyperactive Member DubweiserTM's Avatar
    Join Date
    Dec 2005
    Location
    St-Ferdinand, Québec
    Posts
    427

    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...

  6. #6

    Thread Starter
    Hyperactive Member DubweiserTM's Avatar
    Join Date
    Dec 2005
    Location
    St-Ferdinand, Québec
    Posts
    427

    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 !
    DubweiserTM

    If your question has been answered, you can mark a thread as resolved...

  7. #7
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    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:
    1. Dim f As Form
    2.     For Each f In Forms
    3.         If f.Name = "Form1" Then
    4.             'it is loaded...
    5.                 Exit Sub
    6.         End If
    7.     Next
    8.         '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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width