- . Delphi , , . Label (), Edit ( ) Memo ( ). , .
StaticText ( ) | Additional | Label, . Caption. | |
Panel () | Standard | , . Caption. | |
MaskEdit ( ) | Additional | . Text EditText. | |
RichEdit ( RTF) | Win32 | , . Lines. | |
ListBox ( ) | Standard | Windows, . Items. | |
CheckListBox ( ) | Additional | ListBox CheckBox . | |
ComboBox ( ) | Standard | ListBox Edit. , . Items. |
(With)
. .
:
With <> Do <>;
,
Form1.label1.left:= form1.label1.left + 10;
Form1.label1.caption:=label2.caption;
Form1.label1.font.color:= clred;
with :
With form1.label1 do
Begin
left:= left + 10;
caption:=label2.caption;
font.color:= clred;
end;
TImage
Delphi : (*.bmp), (*.ico) (*.wmf, *.emf). Canvas ( !)
:
AutoSize | / , |
Canvas | |
Center | , |
Picture | |
Stretch | / , |
Transparent | / |
TShape
|
|
:
stCircle
stRounrSaustre
stSquare
stEllipse
stRectangle
stRoundRect
. Brush Pen, Shape, .
TPaintBox
TPaintBox (Canvas), Font, Pen, Brush. OnPaint.
11
:
1. TPanel, Caption.
2. TButton .
3. ( ) TImage Align alClient.
4. TOpenPictureDialog ( Dialogs) .
5. OnClick:
Begin
If OpenPictureDialog1.Execute then
Begin
Image1.Picture.LoadFormFile(OpenPictureDialog1.FileName);
Image1.Stretch:= True { , }
End;
End;
PaintBox , .
procedure TForm1.PaintBox1Paint (Sender: TObject);
var x, y: integer;
begin
with paintbox1.Canvas do
begin
brush.Color:=clred; ellipse(0,0,620,420); font.Name:='arial';
font.Size:=height div 5; font.Style:=[fsbold,fsitalic];
font.Color:=clwhite;
x:=(620 - textwidth('Delphi')) div 2; y:=(420 - textheight('D')) div 2;
textOut(x,y,'Delphi')
end; end;
:
1. (a1,a2) .
2. .
3. .
TStringGrid
TScrollBar , . . , . , FixedCols FixedRows .
. , , . , .
|
|
:
BorderStyle | : bsNone , bsSingle 1 |
Cells [ col, row ] | (col,row) |
Col | , |
ColCount | |
ColWidths | Index |
EditorMode | / . , Options goAlwayseShowEditor goEditing |
FixedColor | |
FixedCols | |
FixedRows | |
GridHeight | |
GridLineWidth | , |
GridWidth | |
Row | , |
RowCount | |
RowHeights | Index |
Rows | Index |
ScrollBars | : ssNone ; ssHorizontal ; ssVertical ; ssBoth . |
12
[0,0] Cells:
StringGrid1.Cells[0,0]:=IntToStr(5)
1. , :
1. | .. | |
2. | .. | |
3. |
2. 44, . , .
3. , .
. .
Delphi . , , , .
VAR < >: ARRAY [<type1, type2,>] OF <type>;
[<type1, type2,>]
< type > -
. , Real. .
Var a: array[1..10] of integer; -
Var t: array[1..2,1..2] of real; - 22.
Var a1: array [A..Z] of word;
a[1] a.
t[1,2] .
, .
i:=1; a[i] - a; a[i+1] .
:
, var a: array of integer;
: SetLength(a, 10); - 10 .
:
for i:= Low(a) to High(a) do i: integer;
13
:
1. .
2. , , , 5 .
3. 10 .
4. .
5. .
|
|
6. .
7. .
8. .
9. , .
10. . .
11. . .
N |
12. . .