Results 1 to 4 of 4

Thread: is there a form-after-load event in VB?

  1. #1

    Thread Starter
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    Resolved is there a form-after-load event in VB?

    What I want to do is:
    1) Show the form;
    2) Check something, if false, then just show a msgbox, then close form

    if I do this in form_load event, the form does not show up when msgbox shows up. After I close msgbox, the form shows up very quick then close. I do not want see the form flashes on the screen.

    what I'm doing now is:
    1) show the form;
    2) in load event, turn on timer, wait 2 seconds;
    3) in timer event, check that.

    Is there a better way to do this?


    thanks
    Last edited by temp_12000; May 27th, 2005 at 05:14 PM.



  2. #2
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: is there a form-after-load event in VB?

    Why are you using a timer? Why don't you just do the checking in the form_load event? Then if you find what you want to be true, show the form and if false show a msgbox and end the app.


    Has someone helped you? Then you can Rate their helpful post.

  3. #3
    Fanatic Member Blade's Avatar
    Join Date
    Jan 1999
    Location
    Stoke-on-Trent, UK
    Posts
    527

    Re: is there a form-after-load event in VB?

    if you want the form showing before the messagebox, put Me.Show just before the msgbox line.
    ie.
    VB Code:
    1. Private Sub Form_Load()
    2. Me.Show
    3. MsgBox "My message box"
    4. Unload Me
    5. End Sub

  4. #4

    Thread Starter
    Hyperactive Member temp_12000's Avatar
    Join Date
    Jan 2004
    Location
    LA, USA
    Posts
    411

    Re: is there a form-after-load event in VB?

    Quote Originally Posted by Blade
    if you want the form showing before the messagebox, put Me.Show just before the msgbox line.
    ie.
    VB Code:
    1. Private Sub Form_Load()
    2. Me.Show
    3. MsgBox "My message box"
    4. Unload Me
    5. End Sub
    cool, this works. thanks for every1.



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