線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:846
推到 Plurk!
推到 Facebook!

请教:Delphi中一些控件的刷新问题...谢谢

尚未結案
Perva
一般會員


發表:13
回覆:9
積分:4
註冊:2003-03-31

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-15 15:49:17 IP:61.168.xxx.xxx 未訂閱
请教:Delphi中一些控件的刷新问题 例:TLabel等,在系统运行过程中不能自动刷新吗? 如果是,真的令人遗憾,其他工具(VC、PB等)都能自动刷新的, 不用老是写ReFresh 请教老师们的高见!谢谢
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-15 15:55:14 IP:147.8.xxx.xxx 未訂閱
Any problem? TLabel and other controls should be able to refresh themself. Maybe your main thread is running into a time consuming loop and thus the controls get no chance in updating?
Perva
一般會員


發表:13
回覆:9
積分:4
註冊:2003-03-31

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-16 08:53:28 IP:61.168.xxx.xxx 未訂閱
谢谢william的指点, 在较长的运行过程中,用户需要知道进行到什么状态,这当然是在一个类似强循环的情况下。
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-16 09:17:38 IP:147.8.xxx.xxx 未訂閱
You may include Application.ProcessMessages; within your loop to allow other controls in repainting itself. Beware of any unexpected events (e.g. button/menuitem click, etc.), so you would like to disable some controls. A better solution is to create a thread for your lengthly loop. Please note that VCL is not thread safe and you should always handle GUI in your main thread (i.e. using Synchorize in the thread for VCL update)
系統時間:2024-05-06 2:36:58
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!