[RESOLVED] Splash Screen Timer not working
I've decided my app needs a splash screen while it pre-loads a bunch of controls in different forms.
frmSplash is called from frmMain's load event.
frmSplash has one label that says "Loading" and beside it is another label(lblDot).
Then there's a timer to change the number of periods in lblDot.
The timer is enabled and set to 500 ms.
But it only fires once.
I've tried moving the timer to frmMain, but it's still not working.
Do timers require DoEvents before they'll work?
Any other ideas?
Code:
Private Sub tmrLoad_Timer()
Static lCnt As Long
lCnt = lCnt + 1
If lCnt > 9 Then
lCnt = 1
End If
frmSplash.lblDot.Caption = String$(lCnt, ".")
End Sub
Re: Splash Screen Timer not working
First thing I would do is put a debug.print to test if lCnt is changing, and watch the debug window :-)
Re: Splash Screen Timer not working
Quote:
Originally Posted by smUX
First thing I would do is put a debug.print to test if lCnt is changing, and watch the debug window :-)
I did it a bit diff, I added a Beep to the timer sub.
It only happens once.
Re: Splash Screen Timer not working
Then I would suggest you do something you mentioned previously, and put a DoEvents in your timer event. 500ms is a short time, it's possible (although unlikely) that the timer doesn't finish its stuff before it is time to re-fire and it gives up.
Also try the debug.print thing, just in case the beep isn't repeating for one reason or another despite the event firing :-)
Re: Splash Screen Timer not working
I've tried the debug.print and just placing stops, nogo
I would think the DoEvents would need to be in the control's loading sub.
But I didn't think timers needed that.
Re: Splash Screen Timer not working
Apparently DoEvents are required.
I placed about 25 of them in the app, several inside loops.
Did get an added bonus out of it.
Anytime there was a long pause between 'periods' I'd pause the app.
That let me find several cbo's that auto load other combos when clicked.
I set a global g_bLoaded to block that till things are set up.
It cut the loading time in half :D