你先用checkbox与edit做一个组件,然后在这个组件中完成你的要求,以后你要用到这个组件,只要直接调用就行了
解决方案 »
- 求 用 Indy 下的IDHTTP 写过从网站IIS一个目录下下载文件的程序啊。
- 请教delphi里面有没有可以指定截取一段字符串的一部分的函数啊?
- 有没有强制类型转换函数 我有 一个 8923abcd这样的一串数 其中8923是整型的。abcd是字符型的 我想把8923abcd转换成字符的 用什么函
- fastreport多表打印,再不解决就要死人了。
- 如何实现多用户批量提交记录到服务器上 (百分送上 高手快来)
- 呜……为什么会失眠?
- 服务端怎么写,可同时连接几十万人?
- 好书推荐:http://www.csdn.net/Expert/TopicView1.asp?id=645424
- 小妹?^_^?:捉虫:求时间段的函数?
- 谁有base64的接码函数?
- ☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆| 已知一个打开对话框的hWnd,怎样设置它浏览的路径?
- 请问:如何在Delphi中定义全局函数以及怎样调用该函数
var i: integer;
Component: TComponent;
begin
if Sender is TCheckBox then
begin
i := strtoIntDef(Copy(TCheckBox(Sender).Name, 9, 2), 1);
if FindComponent('Edit' + Inttostr(i)) <> nil then
begin
TEdit(FindComponent('Edit' + Inttostr(i))).enabled := TCheckBox(Sender).Checked;end;
end;
end;
var i: integer;
begin
if Sender is TCheckBox then
begin
i := strtoIntDef(Copy(TCheckBox(Sender).Name, 9, 2), 1);
if FindComponent('Edit' + Inttostr(i)) <> nil then
TEdit(FindComponent('Edit' + Inttostr(i))).enabled := TCheckBox(Sender).Checked;
end;
end;
count:=Form1.ComponentCount;
j:=1; // j 用来遍历所有控件
repeat
if Components[j] is TEdit then
if j:= strtoIntDef(Copy(TCheckBox(Sender).Name, 9, 2), 1);
TTEdit (Components[j]).enabled:=TCheckBox(Sender).Checked;
j:=j+1;
Until j=Count ;