请问如何实现让form里面(C/S架构)的所有textBox 和 comboBox 等其他控件全部为:背
请问如何实现让form里面(C/S架构)的所有textBox 和 comboBox 等其他控件全部为:背景颜色为windows ;readonly为 false...如delphi可以这样;
for i:=0 to Componentcount-1 do
begin
if components[i] is tedit then
begin
(components[i] as tedit).Color:=clBtnFace;
(components[i] as tedit).ReadOnly:=true;
end;
if components[i] is tcombobox then
begin
(components[i] as tcombobox).Color:=clBtnFace;
(components[i] as tcombobox).Enabled:=false;
(components[i] as tcombobox).Style:=csDropDown;
end;
if components[i] is tdatetimepicker then
begin
(components[i] as tdatetimepicker).Color:=clBtnFace;
(components[i] as tdatetimepicker).Enabled:=false;
end;
if components[i] is tmemo then
begin
(components[i] as tmemo).Color:=clBtnFace;
(components[i] as tmemo).Enabled:=false;
end;
end;