首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

求注解,该怎么处理

2012-04-03 
求注解For i : 0 to Self.ComponentCount - 1 doIf Self.Components[i] is tdbEdit thentdbedit(Self.Com

求注解
For i := 0 to Self.ComponentCount - 1 do
  If Self.Components[i] is tdbEdit then
  tdbedit(Self.Components[i]).Readonly := True
  else If Self.Components[i] is tdbCombobox then
  tdbCombobox(Self.Components[i]).Readonly := True;

[解决办法]
用FOR遍历SELF下的控件,SELF默认为FORM
如果控件是tdbEdit(输入框)或者下拉列表框(dbCombobox)----》》设置其为只读属性
[解决办法]
循环窗体/容器/其它(Self代表什么就是什么)中的组件
判断是不是tdbEdit类
是,设定它的Readonly为true
不是tdbEdit类,再判断是不是tdbCombobox类
是,设定它的Readonly为true

tdbedit(Self.Components[i])是强制转换,也可以这样写:(Self.Components[i] as tdbedit)

热点排行