[VB]有關Dialog同埋Timer問題

我寫左個程式
要同時用Timer同埋Dialog
佢開左個Dialog出黎之後呢 Timer就會好似比人Pause左咁
要個Dialog關左先會識得番做野
有冇辦法解決呢個問題?

可能要用multithread call 個dialog

TOP

原帖由 allenkwc 於 2008-12-13 20:03 發表
可能要用multithread call 個dialog

咩係multithread

TOP

可唔可以噤制果個陣就disable個timer
close左個dialog就enable返個timer?

TOP

原帖由 iamsaisai 於 2008-12-13 21:26 發表
可唔可以噤制果個陣就disable個timer
close左個dialog就enable返個timer?

我唔係想咁
我係想個Dialog彈左出黎都繼續run個Timer

TOP

delete

[ 本帖最後由 Rudy 於 2008-12-14 00:22 編輯 ]

TOP

原帖由 benleung 於 2008-12-13 22:33 發表

我唔係想咁
我係想個Dialog彈左出黎都繼續run個Timer


咁咪整兩個timer lor....

dialog出黎就停1個囉

TOP

C#

void myShowDialog(String msg){
MessageBox.Show(msg);
}

Thread t1 = new ThreadStart(myShowDialog);

好似係咁上下

TOP

應該要 Thread t1= new Thread (new ThreadStart(myShowDialog));
t1.Start();

in vb.net style:(need to import system.threading)
Dim t1 as Thread(AddressOf myShowDialog)
t1.start()

i m not sure u can use multi-threading easily in vb
but it's much easier in vb.net as c#....becuz both use the same library...


不如你講清楚d你個timer係有d乜野用....
"會好似比人Pause左咁"<<哩個唔係好明..

即係你background有個function run 緊,如果開dialog就pause左佢定係點??

TOP

原帖由 iamsaisai 於 2008-12-14 02:51 發表
應該要 Thread t1= new Thread (new ThreadStart(myShowDialog));
t1.Start();

in vb.net style:(need to import system.threading)
Dim t1 as Thread(AddressOf myShowDialog)
t1.start()

i m not sure u can use ...

我個Timer就係用黎整一個走馬燈既....
咁個Timer會不斷將一句字係果個位走黎走去
咁但係當我Call個Dialog出黎 d Timer就會hold住晒 所有Timer都會hold住晒

TOP