예] 스트링그리드의 이름 : SGrid
procedure TForm1.SGridDrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
begin
with (Sender as TStringGrid) do
begin
if ARow = Row then
begin
Brush.Color := cl
Brush.Color := clYellow; // 위의 줄 삭제
FillRect(Rect);
Font.Color := clBlue;
Font.Style := [fsBold]; // 글씨를 강조할 경우, 아니면 줄 삭제
TextOut(Rect.Left+2, Rect.Top+2, Cells[ACol,ARow]);
end;
end;
end;
이렇게 하면 현재 선택된 행이 원하는 색깔로 표시됩니다.
|