I need to wait for some events in my application, or wait for somew time to elaps before doing some other stuff
i tried this pseudo code in vb6
starttime=gettickcount
do
endtime=gettickcount
if endti开发者_如何学Gome-starttime=>waittime then exit do
doevents()
loop
But this seems to freezes the gui, i need an alternative method that will wait without freez the gui
EDIT i forgot the doevents, please take note
I suggest using a timer. A timer fire off an event whenever it reaches it's tick count. So you could tell something to fire every 3 seconds, 3 minutes, 1 hour, etc.
The timer will run in the background allowing your app to continue functioning as normal while it counts down.
Add "DoEvents" in your vb6 code... it allows the app to repaint...
精彩评论