자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 Q&A 이용 (제품 구매 고객 한정)

procedure TForm1.StringGrid1DrawColumnCell(Sender: TObject;
  const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF;
  const Row: Integer; const Value: TValue; const State: TGridDrawStates);
const
  HorzTextMargin = 2;
  VertTextMargin = 1;
var
  TextLayout : TTextLayout;
  TextRect: TRectF;
begin
  if Column = StringColumn1 then
  begin
    TextRect := Bounds;
    TextRect.Inflate(-HorzTextMargin, -VertTextMargin);
    Canvas.FillRect(Bounds, 0, 0, AllCorners, 1);
    TextLayout := TTextLayoutManager.DefaultTextLayout.Create;
    try
      TextLayout.BeginUpdate;
      try
        TextLayout.WordWrap := False;
        TextLayout.Opacity := Column.AbsoluteOpacity;
        TextLayout.HorizontalAlign := StringGrid1.TextSettings.HorzAlign.tacenter;
        TextLayout.VerticalAlign := StringGrid1.TextSettings.VertAlign;
        TextLayout.Trimming := TTextTrimming.Character;
        TextLayout.TopLeft := TextRect.TopLeft;
        TextLayout.Text    := Value.ToString;
        TextLayout.MaxSize := PointF(TextRect.Width, TextRect.Height);
//        TextLayout.Font.Family := 'Times New Roman';
//        TextLayout.Font.Style := [ TFontStyle.fsBold ];
//        TextLayout.Font.Size := 14;
        TextLayout.Color := TAlphaColors.Red;
      finally
        TextLayout.EndUpdate;
      end;
      TextLayout.RenderLayout(Canvas);
    finally
      TextLayout.Free;
    end;
  end;
end;


해당컬럼의 색을 변하지 않게 하는 방법이 없나요 ??


번호 제목 글쓴이 날짜 조회 수
공지 [프로그래밍 강의] 2021.6~2021.12 관리자 2015.01.22 15766
공지 유용한 관련 사이트 관리자2 2014.03.20 54580
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 97985
154 [질문] 안드로이드 Target에 장치가 로딩되지 않습니다. [1] 이대희 2014.11.27 1664
153 datasnap 서버작성후 연결문제 [1] file 다존 2014.11.25 909
152 [XE6] 잘 되던 놈이 갑자기 이런메세지가 나네요.... 어려워 2014.11.22 1486
151 델파이로 맥 애플리케이션을 만들었는데 오라클 DB에 FireDAC으로 어떻게 연결하나요? 관리자 2014.11.21 1098
150 델파이 앱개발 및 datasnap 개발 문의 [1] 네임 2014.11.19 2158
149 [xe7] 간단한 질문 몇가지 입니다. [1] secret hims 2014.11.18 4
» [XE6] StringGrid의 정렬에 대한 자료를 찾았는데 컬럼의 색이 변합니다. 어려워 2014.11.18 1644
147 [XE6] 안드로이드 개발중입니다. [3] 어려워 2014.11.17 1306
146 [BaaS] 파일 목록 가져오기 및 삭제 문의드립니다. 멀면벙커링 2014.11.14 1225
145 Delphi XE5 Professional ESD 문의 [1] GearFit 2014.11.06 1275
144 firemonkey mobile application에서 버튼 드래그 앤 드롭 작동 문제 [1] superman 2014.11.02 1641
143 [XE6] 나의 도서관앱따라하기에서 블랙스크린이 생기며 실행되지 않네요. [3] 어려워 2014.11.01 1640
142 [XE6] 자체 웹브라우저에서 다른 앱호출하기 가을이다 2014.10.31 1825
141 [XE6] 앱을 숨겼다가 다시 보일때에 이벤트 [1] 가을이다 2014.10.30 1560
140 Exception in safecall method 발생 superman 2014.10.29 1441
139 외부 자바파일 연동중에 근우아빠 2014.10.23 1754
138 [XE6] InApp 결제 개발 가을이다 2014.10.23 1488
137 XE6 ScrollBox 문의드립니다. file 신동근 2014.10.22 1374
136 ios 컴파일 오류 문의 [1] 프리스켄 2014.10.08 2155
135 TCameraComponent 의 버그? [1] file habarena 2014.10.14 2200