zoukankan      html  css  js  c++  java
  • 清除面板上所有控件的值

    procedure Pub_ClearOnePanCondition(APan: TWinControl);
    var
      intI: integer;
      PanTemp: TScrollBox;
    begin
      for intI := 0 to APan.ControlCount - 1 do
      begin
        if (APan.Controls[intI] is TScrollBox) then
        begin
          PanTemp := TScrollBox(APan.Controls[intI]);
          Pub_ClearOnePanCondition(PanTemp);
        end;
    
        if (APan.Controls[intI] is TPanel) then
          Pub_ClearOnePanCondition(TPanel(APan.Controls[intI]));
    
        if (APan.Controls[intI] is TCustomEdit) then TCustomEdit(APan.Controls[intI]).Text := '';
    
        if (APan.Controls[intI] is TCheckBox) then TCheckBox(APan.Controls[intI]).Checked := False;
        if (APan.Controls[intI] is TRzCheckBox) then TRzCheckBox(APan.Controls[intI]).Checked := False;
        if (APan.Controls[intI] is TComboBox) then
        begin
          if TComboBox(APan.Controls[intI]).Style = csDropDownList then
            TComboBox(APan.Controls[intI]).ItemIndex := -1
          else
          begin
            TComboBox(APan.Controls[intI]).ItemIndex := -1;
            TComboBox(APan.Controls[intI]).Text := '';
          end;
        end;
        if (APan.Controls[intI] is TRzComboBox) then
        begin
          if TRzComboBox(APan.Controls[intI]).Style = csDropDownList then
            TRzComboBox(APan.Controls[intI]).ItemIndex := -1
          else
          begin
            TRzComboBox(APan.Controls[intI]).ItemIndex := -1;
            TRzComboBox(APan.Controls[intI]).Text := '';
          end;
        end;
        if (APan.Controls[intI] is TDateTimePicker) then TDateTimePicker(
          APan.Controls[intI]).Checked := False;
        if (APan.Controls[intI] is TRZDateTimePicker) then TRZDateTimePicker(
          APan.Controls[intI]).Checked := False;
        if (APan.Controls[intI] is TRZDateTimeEdit) then TRZDateTimeEdit(
          APan.Controls[intI]).Clear;
    
        if (APan.Controls[intI] is TRadioGroup) then
        begin
          if TRadioGroup(APan.Controls[intI]).Items.Count > 0 then
          begin
            if TRadioGroup(APan.Controls[intI]).Tag > 0 then
              TRadioGroup(APan.Controls[intI]).ItemIndex := TRadioGroup(APan.Controls[intI]).Items.Count - 1
            else TRadioGroup(APan.Controls[intI]).ItemIndex := 0;
          end;
        end;
      end;
    end;
    

      

  • 相关阅读:
    【LeetCode】650. 只有两个键的键盘
    【LeetCode】70. 爬楼梯
    【LeetCode】746. 使用最小花费爬楼梯
    【LeetCode】198. 打家劫舍
    【LeetCode】53.最大子序和
    【LeetCode】1056-易混淆数
    【人工智能系列】python的Quepy库的学习
    【计划书】关于运营商的人工智能的想法
    【转】经典!python中使用xlrd、xlwt操作excel表格详解
    转]python 结巴分词(jieba)学习
  • 原文地址:https://www.cnblogs.com/rogge7/p/4498667.html
Copyright © 2011-2022 走看看