开发者

sleep without freezing gui vb6

开发者 https://www.devze.com 2023-02-26 06:40 出处:网络
I need to wait for some events in my application, or wait for somew time to elaps before doing some other stuff

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...

0

精彩评论

暂无评论...
验证码 换一张
取 消