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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
| program FenSimple;
uses
Windows, Messages, SysUtils, Variants, Classes,StdCtrls, Graphics, Controls, Forms,
Dialogs;
(*Unit1 in 'Unit1.pas' {Form1};
//{$R *.res} *)
//uses Forms, Dialogs, SysUtils;
(*type
TForm1 = class(TForm)
HelloButton : TButton;
procedure MyEventHandler(Sender: TObject);
end;*)
var
Form1: TForm;
Button : TButton;
labelou:Tlabel;
//implementation
//{$R *.dfm}
(*procedure TForm1.MyEventHandler(Sender: TObject);
begin
ShowMessage('Hello There!');
end;*)
procedure creFen;
begin
//Form1:=TForm.create(Application); placé ici,c'est la fiche par défault qui est créée
with Form1 do
Begin
//BorderStyle:= bsNone;
color:=clYellow;
Left:= 388;
Top:= 200;
width:=352;
height:=258;
caption:='Ma Fenetre';
//Execute;
//Free;
//ShowMessage('Hello There!');
//Form1:=TForm.create(Application);Placé ici,çà ne change rien la fiche se crée
end;
end;
procedure bouton;
begin
with Button do
Begin
button := TButton.Create(Form1); //self a la place de form
button.Caption := 'Run-time';
button.Width := 50;
button.Height := 20;
button.Top := 50;
button.Left := 20;
button.Visible := True;
button.Parent := Form1; //ajouter aussi ça
end;
end;
procedure etiquette;
begin
with labelou do
begin
labelou:=Tlabel.create(Form1);
labelou.caption:='On avance';
labelou.Width := 100;//Largeur
labelou.Height := 60;//hauteur
labelou.Top := 100;
labelou.Left := 105;
labelou.Visible := True;
labelou.Parent := Form1;
end;
end;
(*procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
end;*)
begin
//Application.Initialize;
Application.CreateForm(TForm, Form1);//, Form1
creFen;
bouton;
etiquette;
Application.Run;
end. |