Delphi 를 쓰다보면 가장 접하기 쉬운 그리드
기능이 적어서 가벼운 그리드인 스트링그리드(TStringGrid)를 제어하는 법을 간단히 정리해 보았습니다.
1. 스트링 그리드 ROW 삭제
var
i: Integer;
begin
// String Grid ROW 삭제
for i := StringGrid5.Row to StringGrid5.RowCount - 2 do
StringGrid5.Rows[i].Assign(StringGrid5.Rows[i + 1]);
StringGrid5.RowCount := StringGrid5.RowCount - 1;
2. 컬럼 숨기기
StringGrid5.Colwidths[3] := -1;
3. 그리드 중간에 빈ROW 삽입하기
TStringGridMove = class(TStringGrid)
public
procedure RowMoved(FromIndex, ToIndex: Longint);
end;
procedure TStringGridMove.RowMoved(FromIndex, ToIndex: Integer);
begin
inherited;
end;
// 예제
TStringGridMove(StringGrid1).RowCount = TStringGridMove(StringGrid1).RowCount + 1
TStringGridMove(StringGrid1).RowMoved(TStringGridMove(StringGrid1).RowCount, 3);'Programming > Delphi' 카테고리의 다른 글
| [Delphi] 파일에서 이미지 타입 읽기 (0) | 2026.06.14 |
|---|---|
| [Delphi] 프로그래밍 팁 모음 (0) | 2026.06.09 |
| [Delphi] 웹으로 파일 전송(POST) 하는 프로그램 (0) | 2026.06.08 |
| [Delphi] 웹브라우져 컨트롤을 이용하여 출력하기 (0) | 2026.06.06 |
| DirectShow 기본 Cam 프로그램 (0) | 2026.05.31 |