DELPHI/Sample Source

[delphi / TstringGrid] StringGrid 간단 문법 사용 예제

Kim.Sung 2021. 1. 29. 14:31
728x90

※ TstringgGrid 간단 문법 예제 이다.

※ 사용 언어 : DelphiXE3

 

1. 실행 화면 

 

2. Sample Source

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
 with StringGrid1 do
  begin
     ColCount  := 10;
 
     FixedCols := 1;
     FixedRows := 1;
 
     DefaultRowHeight := 20;
     DefaultColWidth  := 80;
 
     Cells[00,0] := '1';
     Cells[01,0] := '2';
     Cells[02,0] := '3';
     Cells[03,0] := '4';
     Cells[04,0] := '5';
     Cells[05,0] := '6';
 
     for i := 0 to 5 do
     begin
       StringGrid1.Cells[0,i+1] :=  IntToStr(2 + i);
       StringGrid1.Cells[1,i+1] :=  IntToStr(3 + i);
       StringGrid1.Cells[2,i+1] :=  IntToStr(4 + i);
       StringGrid1.Cells[3,i+1] :=  IntToStr(5 + i);
       StringGrid1.Cells[4,i+1] :=  IntToStr(6 + i);
       StringGrid1.Cells[5,i+1] :=  IntToStr(7 + i);
     end;
 
  end;
cs
728x90