procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
begin
if Components[I] is TEdit then
(Components[I] as TEdit).ReadOnly := False;
end;
end;
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
begin
if Components[I] is TEdit then
(Components[I] as TEdit).ReadOnly := False;
end;
end;
解决方案 »
- 大家看看错在哪里?
- 难!使用express bar做toolbar时出现这样的问题
- 如果更改一个已经编译好的delph文件的菜单项
- 怎样将文本型数据转化成double型数据
- 奇怪!!!!!!!!!!!!!!!!!!!!!!!!!!!!用ADO不行,用ODBC就可以?why?
- 数据库中的BLOB字段怎么导入到excel中去
- 如果切换BUTTON的图片,像QQ一样。是读取地址,而不是DATA类型
- delphi编写的动态链接库怎样回传字符串给C#程序
- 千两狂死郎请进!!!!
- 请问各位老兄,论坛里如GZ,UP之类的略语是什么意思?
- 周末大放送,终于可以休息了!来者有份哟!
- 高分求解有关文件夹的简单问题(UP有分,不够再给)
i: integer;
begin
for i := 0 to ComponentCount - 1 do
begin
if (Components[i] is TEdit) then
TEdit(Components[i]).ReadOnly:= False;
end;
end;
var
I : Integer;
begin
for I:= 0 to ControlCount -1 do begin
if Controls[I] is TEdit then
(Controls[I] as TEdit).ReadOnly := True;
//(Controls[I] as TEdit).Text:='222';
end;
end;
i: integer;
begin
for i := 0 to ComponentCount - 1 do
TControl(Components[i]).ReadOnly:=(Components[i] is TEdit);
end;
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
begin
if Components[I] is TEdit then
TEdit(Components[I]).ReadOnly := False;
end;
end;
i: integer;
begin
for i := 0 to ComponentCount - 1 do
begin
if (Components[i] is TEdit) then
TEdit(Components[i]).ReadOnly:= False;
end;
end;
i: integer;
begin
for i := 0 to ComponentCount - 1 do
begin
if (Components[i] is TEdit) then
TEdit(Components[i]).ReadOnly:= False;
end;
end;
var
i:integer;
begin
for i:=0 to Application.ComponentCount-1 do
begin
if Components[i] is Tedit then
(Components[i] as Tedit).ReadOnly :=true;
end;
end;
就可以了。
在此想请教各位高手,为什么写成以下就不行了呢?
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Application.ComponentCount-1 do
begin
if Application.Components[i] is Tedit then
(Application.Components[i] as Tedit).ReadOnly :=true;
end;
end;