Habe es jetzt so:
Delphi-Quellcode:
for i := 0 to Mainform.ComponentCount - 1 do
Begin
if (Mainform.Components [i]).tag=1 then
Begin
if (Mainform.Components[i] is TEdit) then
Begin
TEdit(Mainform.Components[i]).Color :=cl3DLight;
TEdit(Mainform.Components[i]).readonly :=true;
end
else if (Mainform.Components[i] is TMemo) then
Begin
TMemo(Mainform.Components[i]).Color :=cl3DLight;
TMemo(Mainform.Components[i]).readonly :=true;
end
else if (Mainform.Components[i] is TListbox) then
TMemo(Mainform.Components[i]).Color :=cl3DLight;
end //if
else
Begin
if (Mainform.Components[i] is TEdit) then
Begin
TEdit(Mainform.Components[i]).Color :=clwindow;
TEdit(Mainform.Components[i]).readonly :=false;
end
else if (Mainform.Components[i] is TMemo) then
Begin
TMemo(Mainform.Components[i]).Color :=clwindow;
TMemo(Mainform.Components[i]).readonly :=false;
end
else if (Mainform.Components[i] is TListbox) then
TMemo(Mainform.Components[i]).Color :=clwindow;
end //if
end;//for
gelöst. Scheint mir nur irgendwie sehr "aufgebauscht". Die Methode von Bernhard werde ich mir heute nach der Arbeit mal anschauen... habe das Gefühl, dass das länger dauern wird
MFG
Steffen