|
-
Oct 21st, 2008, 01:59 PM
#1
Thread Starter
Frenzied Member
[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
-
Oct 21st, 2008, 02:06 PM
#2
PowerPoster
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 :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Oct 21st, 2008, 02:09 PM
#3
Thread Starter
Frenzied Member
Re: Splash Screen Timer not working
 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.
-
Oct 21st, 2008, 02:20 PM
#4
PowerPoster
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 :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
Oct 21st, 2008, 02:26 PM
#5
Thread Starter
Frenzied Member
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.
-
Oct 21st, 2008, 02:59 PM
#6
Thread Starter
Frenzied Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|