1
.
. Object Pascal, Delphi :
.
1. , , . . , , , , .
2. File Þ New ÞApplication , Delphi, , .
3. Standard Form1 : Labell, Label2, Label3, Label4, Edit1, Edit2, Button1, Button2, Button3 (. . 3).
. , . , , , .
.3.
Label1, Label2, Label3, Label4 , . , . Label1 , Label2 " ", Label3 " ", Label4 .
Edit1, Edit2 , . , . , .
Button1, Button2, Button3 , . Button1 ; Button2 Edit1, Edit2, ; Button3 .
4. . , . .
, , . , , , .
|
|
Caption () Form1 1. .
, , . ( ) , , . Height () Width (), . , , Height Width . , , , .
, Height Width 480 600 ().
Left . 250 200 () . , . .
5. Labell, Label2, Label3 Label4. Labell, Label2, Label3 Label4 Height, Width, Left Top. , , Left , , . Labell, Label2, Label3 Label4:
Label1 | Label2 | Label3 | Label4 | |
Height | ||||
Width | ||||
Left | ||||
Top |
Caption . Label1 Caption . Label2 Caption , Label3 , Label4 Caption .
AutoSize , , , . , AutoSize True, False.
WordWrap ( ) AutoSize False. WordWrap True, False.
Alignment () , : , .
Label1, Label2, Label3 Label4:
Label1 | Label2 | Label3 | Label4 | |
AutoSize | True | True | True | False |
WordWrap | False | False | False | True |
Aligment | taCenter | taleftJustify | taleftJustify | taleftJustify |
, Caption Label2 , Caption Label4 , , Label4 .
|
|
Font , , , , , .. , Font , . .
Labell, Label2, Label3 Label4:
Label1 | Label2 | Label3 | Label4 | |
Arial | Times New Roman | Times New Roman | Times New Roman | |
, Labell, Label2, Label3 Label4 ParentFont True False. ParentFont , ( Font) -. , . ParentFont True, , . .
6. Height, Width, Left Top Edit1, Edit2 , Labell, Label2, Label3 Label4. Edit1, Edit2:
Edit1 | Edit2 | |
Height | ||
Width | ||
Left | ||
Top |
AutoSize, Edit1, Edit2, , , , . , , True, False. , True.
Text Edit1, Edit2 ( ) . Edit1, Edit2, .
Editl Edit2:
Editl1 | Edit2 | |
Times New Roman | Times New Roman | |
7. Button1, Button2:
Button1 | Button2 | Button3 | |
Caption | |||
Height | |||
Width | |||
Left | |||
Top | |||
Arial | Arial | Arial | |
8. , , , Name (): Form1, Label1, Label2, Label3, Label4, Edit1, Edit2, Button1, Button2 Button3. Delphi , , , . . , , . , Edit1 TEdit, Label1 TLabel.
|
|
, Delphi, . , . , , Delphi.
.
9. .
, . , OnClick Buttonl. OnClick , , , Buttonl. (.
. 4).
. 4. ,
procedure TForm1.Button1Click(Sender: TObject);
var x,y,t,t1:real;
s1:string[7];
code:integer;
begin
{ }
val(edit1.text,x,code);
val(edit2.text,y,code);
{ }
t1:=1/(sqr(x)+4);
t:=(x+y*t1)/(y*(x-1)+t1));
{ }
str(t:7:3,s1);
label4.caption:=''+chr(13)+'t='+s1;
end;
, . , , .
onClick Button2 :
procedure TForm1.Button2Click(Sender: TObject);
begin
Label4.caption:=' ';
edit1.Text:=' ';
edit2.Text:=' ';
end;
onClick Button3 :
procedure TForm1.Button3Click(Sender: TObject);
begin
Close;
end;
.
10. . . File Þ Save All. .
, , . , . , . Unitl. . .
, . Projectl. , - .
, .
Delphi , :
Save ;
Save As ;
Save Project As .
, . , , , , . .
|
|
.