判断groupbox中所有的edit是否为空,并给出空的哪个edit为空(2)

    技术2022-05-19  26

    procedure isNull(grp:TGroupBox);var  I:Integer;const  arr: array[0..1] of string = ('edit1为空', 'edit2为空');begin  for I := 0 to grp.ControlCount - 1 do    begin      if grp.Controls[i] is TEdit then      begin        if (grp.Controls[i] as TEdit).Text = '' then        begin          showmessage(arr[i]);          B:=false;        end;      end;  end; // forend;{判断grp中的edit是否为空}

     

    //调用方式为isNull(grp1)


    最新回复(0)