Delphi DisableConstrol and EnableControl
2010-08-01 15:56
218 查看
DisableControls方法是在程序修改或后台有刷新记录的时候切断数据组件,如TTABLE、ADOQUERY等等与组件数据源的联系。如果没有切断,数据源中只要一有数据的改动,尤其是批量改动的话,每一笔的改动都会更新窗口中数据浏览组件的显示,这样会急剧减慢处理过程而且浪费时间。EnableControls的作用相反,用来恢复TTABLE等组件与DATASOURCE的联系,并促使数据浏览组件更新显示。
enablecontrols,disablecontrols是防止因数据源的改动而造成界面的闪动!在你需要刷新数据时可以调这两个函数,但建议你把它写在try...finally语句块中!
如:
try
adoQuery1.disablecontrols; //先切断联系
adoQuery1.close; //再打开
adoQuery1.open;
finally
adoQuery1.enablecontrols; //恢复联系
end;
enablecontrols,disablecontrols是防止因数据源的改动而造成界面的闪动!在你需要刷新数据时可以调这两个函数,但建议你把它写在try...finally语句块中!
如:
try
adoQuery1.disablecontrols; //先切断联系
adoQuery1.close; //再打开
adoQuery1.open;
finally
adoQuery1.enablecontrols; //恢复联系
end;
相关文章推荐
- Delphi数据库技术中Disablecontrols和Enablecontrols的功能
- button disable and enable
- How to Enable and Disable Root Login in Ubuntu
- use noscript html tag when user disable the javascript in browser, guide user how to enable the js in different browser and retu
- Dell BIOS: Enable VT, 64-bit, and Execute Disable for VMWare
- Delphi数据库技术中Disablecontrols和Enablecontrols的功能
- delphi的数据库技术中的disablecontrols和enablecontrols的功能
- Delphi数据库技术中Disablecontrols和Enablecontrols的功能
- [Project Intro] Disable and enable specified web proxy in code
- 可恶SQL SERVER的索引Disable后不能直接ENABLE,只有rebuild后才OK!SQL SERVER – Disable Clustered Index and Data Insert
- Mysql - disable TCP/IP connections and enable named pipes
- Enable and Disable Extended Topology feature
- How to Check and Enable/Disable Oracle Binary Options (Doc ID 948061.1)
- Delphi TGraphicControl 类 And TWinControl 类
- ApacheDS 2.0__Basic User Guide 1.4.5 - Enable and disable anonymous access (基础用户指导手册)
- 如何扩展主键的长度(DISABLE And ENABLE CHANGE_TRACKING)
- Enable and disable ArcGIS Server Security
- Disable or Enable SSH Root Login and Limit SSH Access in Linux
- How To Enable/Disable Archive Logging In RAC Environment for 10.2 and higher version
- Help for enable SSL 3.0 and disable TLS 1.0..