delphi 禁用掉窗口中的所有组件
2017-03-22 15:25
225 查看
procedure DisableAllControls(m_form: TWinControl; m_enable : Boolean = false); var i : integer; begin //禁用窗口中所有组件 //m_enabled = true 表示启用 for i := 0 to m_form.ComponentCount - 1 do begin if m_form.Components[i] is TCustomTreeView then (m_form.Components[i] as TCustomTreeView).Enabled := m_enable; if m_form.Components[i] is TCustomButton then (m_form.Components[i] as TCustomButton).Enabled := m_enable; if m_form.Components[i] is TCustomDBGridEh then (m_form.Components[i] as TCustomDBGridEh).Enabled := m_enable; if m_form.Components[i] is TToolBar then (m_form.Components[i] as TToolBar).Enabled := m_enable; if m_form.Components[i] is TGroupBox then (m_form.Components[i] as TGroupBox).Enabled := m_enable; end; if m_form is TForm then //最后禁用掉自己 (m_form as TForm).Enabled := m_enable; end;
相关文章推荐
- delphi中最小化其他程序及所有程序最小化(使用 shell.minimizeAll 和自己寻找窗口这两种办法)
- 【C#】无损转换Image为Icon 【C#】组件发布:MessageTip,轻快型消息提示窗 【C#】给无窗口的进程发送消息 【手记】WebBrowser响应页面中的blank开新窗口及window.close关闭本窗体 【手记】调用Process.EnterDebugMode引发异常:并非所有引用的特权或组都分配给呼叫方 【C#】DataRowState演变备忘
- DELPHI 7.0软件 自带有报表 Quick Report组件(TQRShape等所有组件 说明)
- delphi 所有程序运行调试都出现cpu窗口,急!
- WM_ERASEBKGND官方解释(翻译),以及Delphi里所有的使用情况(就是绘制窗口控件背景色,并阻止进一步传递消息)
- Delphi TScrollBar 用于滚动窗口、组件内容
- delphi获取一个窗口的所有子窗口(包括嵌套)
- Delphi获取所有打开的IE窗口的网页源码
- [delphi技术]实现保存窗口上的所有Edit和checkbox状态的类
- Delphi TScrollBar 用于滚动窗口、组件内容
- delphi窗口的create和free,一个古老的话题
- GridView控件 以网格的形式显示所有的组件
- delphi 即时窗口
- delphi命令行窗口实现9*9乘法表
- 将所有输出窗口文本重定向到即时窗口
- Delphi的第三方组件安装组件安装
- 安装Visual Studio后所有程序出异常它霸道的管着----启用/禁用Visual studio实时调试
- 枚举所有IE窗口,实现自动登录
- android 禁用和开启四大组件的方法
- Delphi使用ADO组件访问ACCESS数据入门例程