procedure TForm1.Button1Click(Sender: TObject); begin if button1.Caption = 'showform' then begin Form2.Show; button1.Caption:= 'hideform'; end else begin form2.Hide; button1.Caption:= 'showform' end; end;
procedure TFrmmain.Button1Click(Sender: TObject); begin if button1.Caption = '显示窗体' then begin Form2.Show; button1.Caption:= '隐藏窗体'; end else begin form2.Hide; button1.Caption:= '显示窗体' end; end;
begin
if button1.Caption = 'showform' then
begin
Form2.Show;
button1.Caption:= 'hideform';
end
else
begin
form2.Hide;
button1.Caption:= 'showform'
end;
end;
begin
if button1.Caption = '显示窗体' then
begin
Form2.Show;
button1.Caption:= '隐藏窗体';
end
else
begin
form2.Hide;
button1.Caption:= '显示窗体'
end;
end;