.


:




:

































 

 

 

 


TstringGrid




Cells(NCol, NRow:Integer): String - (NCol, NRow).

Col: Longint - , .

Row: Longint - , .

ColCount: Longint - .

RowCount: Longint - .

FixedCols: Integer - .

FixedRow: Integer - .

+TgridOption = set of TGridOptions - ,

goFixedVertLine - ;

goFixedHorzLine - ;

goVertLine - ;

goHorzLine - ;

goRowSelect - ;

goEditing - , , goRowSelect.

 

7.

.

1. TstringGrid

2.

3.

4. ,

5.

 

1. TstringGrid.

1 Object TreeViewStringGrid1 1Object Inspector Ì Properties

ColCount 4 //-

RowCount 4 //-

FixedCols 1 //=

FixedRows 1 //=

+TgridOption

goVertLine True //

goHoizLine True //

goEditing True //

 

. OnEnter, .

1 Object TreeViewStringGrid1 1Object Inspector ÌEvents

OnEnter ( )

[i, 0]

[j, 0]

 

procedure TForm1.StringGrid1Enter(Sender: TObject);

Var I, J: Integer; //

Begin

With StringGrid1 do // StringGrid1

Begin

For I:=1 To ColCount-1 do //

Cells[I,0]:= IntToStr(I);

For J:=1 To RowCount-1 do //

Cells[0,J]:= IntToStr(J);

End;

End;

With StringGrid1
For
For
i=1..ColCount-1
Cells[0, j]:= IntToStr(j)
J =1..RowCount-1
Cells[i,0]:= IntToStr(i)
ColCount - RowCount -
. procedureTForm1.StringGrid1Enter(Sender: TObject)  

KeyPress. , goEditing True, .

procedure TForm1.StringGrid1KeyPress(Sender: TObject; var Key: Char);

Begin

If not (Key in ['0'..'9', '-']) then Key:= #0; //

End;

,

Button1. [i, j] Cells[i, j] i j. Label1.

 

procedure TForm1.Button1Click(Sender: TObject);

var i, j: Integer; //

M: Array [1..3, 1..3] of String; //

Begin

With StringGrid1 do // StringGrid1

For i:=1 to 3 do

for j:= 1 to 3 do

M[i, j]:= Cells[i, j];

With Label1 do // Label1

Begin

Caption:= ''; //

For i:=1 to 3 do

Begin

For j:= 1 to 3 do

Caption:= Caption+ M[i, j] + #9;

Caption:= Caption +#13; //

end; // For i

end // With

End;

. . [i, j] [, ], [, ].





:


: 2016-10-27; !; : 566 |


:

:

- , 20 40 . - .
==> ...

1587 - | 1545 -


© 2015-2024 lektsii.org - -

: 0.01 .