, - .
.
1. Delphi. . File | New Application. No Delphi, .
2. Button Standard . ( ) . , Delphi Button1.
3. Standard Label ( ). . Delphi Label1.
4. , .
5. Button1 . Caption (), Button1 (, Delphi) .
6. Caption Label1, , . , Caption Label1 . . OnClick. , .
7. Button1 , , (Events), OnClick ( ) . . :
procedure TForm1.Button1Click(Sender: TObject);
begin
end
(TForm1), (Button1) On (Click).
8. Label1. :
Label1.Caption:= 'Hello, World!';
Hello, World!.
procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:= 'Hello, World!';
end
Label1, , , . Code Insight, , , . , Enter (, ) .
|
|
, - , - . , Delphi, , , . , Tools | Editor Options Code Insight Code Completion.
, . ( Run | Run). . , . : , , . , .
, Delphi. .dpr .pas. .dpr , , . File | New Form, Project | Remove from Project.
, . , .
unit Unit1;
interface //
{ }
Uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls;
{ }
Type
TForm1 = class (TForm)
Label1: TLabel;
Button1: TButton;
procedure Button1Click (Sender: TObject);
private //
{ Private declarations }
{ ,
, ,
}
public //
{ Public declarations }
{ ,
,
}
end; { }
Var
Form1: TForm1;
{ , ,
, ,
, }
implementation //
{$R *.DFM} -
{ uses,
, , ,
.
interface ,
,
.}
procedure TForm1.Button1Click(Sender: TObject);
Begin
Label1.Caption:= ' Hello, World!';
end;
end.
unit, . , . Unit1, Unit2 ..
:
|
|
interface ,
implementation .
, interface (, , , , ), .
, implementation . , , , , .
interface uses, , , Delphi. TForm1. Label1 Button1. , Button1Click.
:
private ,
public .
, Delphi public, . , private, .
Var
Form1: TForm1
Form1 TForm1, .. TForm1.
implementation, , , , . , . implementation Button1Click , .
implementation , , , . ( ), implementation uses, , . ,
uses Unit2, Unit3;
, Unit2 Unit3.