Learn to build secure applications from the mindset of the hacker and avoid being exploited.
Do more with
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses unit2;
procedure TForm1.Button1Click(Sender: TObject);
begin
form2.Edit1.Text := Form1.Edit1.Text;
form2.Show;
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses uInfo;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowInfo('info', Edit1.Text);
end;
end.
unit uInfo;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TfrmInfo = class(TForm)
lblHeader: TLabel;
lblInfo: TLabel;
btnOk: TButton;
procedure btnOkClick(Sender: TObject);
end;
var
frmInfo: TfrmInfo;
procedure ShowInfo(aHeader, aInfo: string);
implementation
{$R *.dfm}
procedure ShowInfo(aHeader, aInfo: string);
var frm: TfrmInfo;
begin
frm := TfrmInfo.Create(Application);
try
frm.lblHeader.Caption := aHeader;
frm.lblInfo.Caption := aInfo;
frm.ShowModal;
finally
FreeAndNil(frm);
end;
end;
procedure TfrmInfo.btnOkClick(Sender: TObject);
begin
Close;
end;
end.
Premium Content
You need an Expert Office subscription to comment.Start Free Trial