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
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? :ehh: Then if you find what you want to be true, show the form and if false show a msgbox and end the app.
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:
Private Sub Form_Load()
Me.Show
MsgBox "My message box"
Unload Me
End Sub
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:
Private Sub Form_Load()
Me.Show
MsgBox "My message box"
Unload Me
End Sub
cool, this works. thanks for every1.