shzbg1341810374 发表于 2015-12-24 09:02:16

判断与循环语句的应用

var
Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.btn1Click(Sender: TObject);
begin
    Form1.Width := StrToInt(edt1.Text );
    Form1.Height := StrToInt(edt2.Text );
end;

procedure TForm1.btn2Click(Sender: TObject);
begin
    if StrToInt(edt1.Text ) < 400 then
      Form1.Width := 450
    else
      Form1.Width := 600;
    if StrToInt(edt2.text ) < 400 then
      Form1.Height := 400
    else
      form1.Height := 600;
end;

procedure TForm1.btn3Click(Sender: TObject);
var i, m : Integer ;
begin
      Form1.Width := 1;
      Form1.Height := 1;

      if (StrToInt(edt1.Text ) >= StrToInt(edt2.Text )) then
          m := StrToInt(edt1.Text )
      else
          m := StrToInt(edt2.Text );
      for i := 1 to m do
         begin
            Form1.Width := Form1.Width +1 ;
             Form1.Height :=form1.Height +1;

          end;
end;

procedure TForm1.btn4Click(Sender: TObject);
begin
    Close ;
end;

end.

xintiandi 发表于 2016-1-7 12:56:58

没看懂什么意思
页: [1]
查看完整版本: 判断与循环语句的应用