标题:请问如何实现让form里面(C/S架构)的所有textBox 和 comboBox 等其他控件全部 ...
取消只看楼主
james_deng
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-7-15
 问题点数:0 回复次数:0 
请问如何实现让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;
搜索更多相关主题的帖子: textBox form 架构 comboBox 控件 
2005-07-21 20:55



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-23396-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.013336 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved