unit Unit2;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons;
type
TForm2 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Label1: TLabel;
Edit1: TEdit;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
function ShowForm1(sCap : String) : Integer;
function ShowForm2(var sCap : String) : Integer;
implementation
{$R *.DFM}
function ShowForm1(sCap : String) : Integer;
begin
Application.HintPause := 500;
Form2 := TForm2.Create(Application);
try
with Form2 do begin
Label1.Caption := sCap;
Result := ShowModal;
end;
finally
Form2.Free;
end;
end;
function ShowForm2(var sCap : String) : Integer;
begin
Application.HintPause := 1000;
Form2 := TForm2.Create(Application);
try
with Form2 do begin
Label1.Caption := sCap;
Result := ShowModal;
sCap := Edit1.Text
end;
finally
Form2.Free;
end;
end;
end.
|