1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Unit2, Unit3, ComCtrls, ToolWin;
type
TForm1 = class(TForm)
ToolBar: TToolBar;
ToolButton: TToolButton;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
procedure ToolButtonClick(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
private
{ Déclarations privées }
fForm2 : TForm2;
fForm3 : tForm3;
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ToolButtonClick(Sender: TObject);
begin
if fForm2 = nil then fForm2 := tForm2.Create(application);
fForm2.Show;
fForm2.BringToFront;
end;
procedure TForm1.ToolButton2Click(Sender: TObject);
begin
if fForm3 = nil then fForm3 := tForm3.Create(application);
fForm3.Show;
fForm3.BringToFront;
end;
end. |
Partager