자유롭게 질의 및 응답을 할 수 있는 게시판입니다. 개발자 여러분의 답변이 큰 도움이 됩니다. 
  • 제품설치/등록 오류 문의: 설치/등록 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 17216
공지 유용한 관련 사이트 관리자2 2014.03.20 56087
공지 본 게시판은 개발자 여러분들의 질문과 답변을 공유하는 공간입니다. 관리자 2012.01.10 99530
2719 Rio 앱 업데이트 관련 오류 문의 [2] 신우 2020.02.11 163
2718 InputBox 질문입니다. 희망나라 2017.03.28 163
2717 10.4 시드니에서 푸시가 (Android, IOS) 가 되는지요? [1] delphiman 2020.10.05 163
2716 xe4 2D 바코드 사용하려면? [1] 왕팝콘 2020.11.17 163
2715 XE8 블럭간 라인(?) 제거법 알려주세요. [2] file 도사 2015.07.16 164
2714 64bit 프로그램 시 오류내용 확인부탁드립니다. [1] file jaky 2017.11.16 164
2713 [시작하는 사람들을 위한 델파이 프로그래밍] 모듈 23 - Exercise 1 관리자 2016.05.27 164
2712 CallBack 문의사항 [1] 파란하늘 2017.07.13 164
2711 Multithread 한시민 2017.12.19 164
2710 keystore [3] 희망나라 2018.01.12 164
2709 안드로이드 앱 개발 중 발생하는 오류 관련해 문의 드립니다. [1] file 관리자 2018.02.01 164
2708 Serial 통신 에러 관련해서 문의드립니다. [1] 김제언 2018.03.05 164
2707 mousedown 에서의 shift상태 [1] 100jk 2018.12.27 164
2706 STL allocator 관련 컴파일 질문 드립니다. [1] kang 2019.03.04 164
2705 C++ 빌더 10.4 Data Base Form에 Data Base Component들이 안보임 [2] file 꼬꼬마 2021.03.11 164
2704 델파이 10.3.3 Rio 에서 fastreport 가 어디 있나요? [1] 노력하는삶 2020.02.04 164
2703 XE6에서 FastReport [1] file 나도몰라 2015.11.02 164
2702 Delphi 10.1 Berlin Update2 사용중 문제. [1] file 김재욱 2017.02.23 164
2701 질문] 코드사이트 중국어 표기 [1] 날개의꿈 2021.02.26 164
2700 FD관련 에러, 이런 곤란을 겪어야만 사용가능하는지.. [1] file datare 2015.06.17 165