C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[66926] Re:그리드에 문자 넣기
송신영 [palindrome] 1300 읽음    2012-04-17 16:11
참고하세요.

    // 이전 설정 저장.
    unsigned oldalign = SetTextAlign(StringGrid1->Canvas->Handle, TA_CENTER);
    TColor OldColor_Font = StringGrid1->Canvas->Font->Color;
    TColor OldColor_Brush = StringGrid1->Canvas->Brush->Color;

    StringGrid1->Canvas->Brush->Color = clRed;                  // 배경색
    StringGrid1->Canvas->Font->Color = clYellow;                // 폰트 색
    StringGrid1->Canvas->Font->Style = TFontStyles() << fsBold; // 폰트 스타일
    StringGrid1->Canvas->Font->Size = 8;                        // 폰트 크기.

    // 텍스트 위치를 가운데로 조정하여 출력.
    StringGrid1->Canvas->TextRect(Rect, (Rect.Right+Rect.Left)/2, Rect.Top+4, "Test");

    // 이전 설정 복원
    SetTextAlign(StringGrid1->Canvas->Handle, oldalign);
    StringGrid1->Canvas->Font->Color = OldColor_Font;
    StringGrid1->Canvas->Font->Style = TFontStyles() >> fsBold;
    StringGrid1->Canvas->Brush->Color = OldColor_Brush;



그리드 님이 쓰신 글 :
: void __fastcall TFrmTempTime::StringGrid1DrawCell(TObject *Sender,
:       int ACol, int ARow, TRect &Rect, TGridDrawState State)
: {

:         StringGrid1->Canvas->Brush->Color = 0x004AAAEA;
:         StringGrid1->Canvas->FillRect(Rect);
:
:         StringGrid1->Canvas->Brush->Color = clBlack;
:         StringGrid1->Canvas->TextOut(ACol, ARow, "TITLE");
:         StringGrid1->Canvas->Font->Size = 20;
:         StringGrid1->Canvas->Font->Style = TFontStyles() << fsBold;   //굵게
:         StringGrid1->Canvas->Font->Name    = "맑은 고딕";


: }
:
: 이렇게 하면 TITLE 이란 문자가 쫙 찍혀야 하느데.. 안됩니다.
:
: 도와주세요. ㅜㅜ

+ -

관련 글 리스트
66925 그리드에 문자 넣기 그리드 858 2012/04/17
66926     Re:그리드에 문자 넣기 송신영 1300 2012/04/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.