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
[41081] Re:Re:StringGeid 글씨가 안보여요,.
evergreen [heredity] 1015 읽음    2005-07-16 21:09
안녕하세요. heredity입니다.
답변 내용이 부실(?)한 것 같아 사용 예를 올립니다.
행복하세요.

void __fastcall TForm1::StringGrid1DrawCell(TObject *Sender, int ACol, int ARow, TRect &Rect, TGridDrawState State)
{
  TCanvas *pCanvas = StringGrid1->Canvas;

  if( State.Contains( gdFocused ) ) {           // Focused Cell인 경우
    pCanvas->Brush->Color = clRed;
    pCanvas->Font->Color = clWhite;
  }
  else if( State.Contains( gdSelected ) ) {     // 블럭 설정된 Cell들
    pCanvas->Brush->Color = clBlack;
    pCanvas->Font->Color = clWhite;
  }
  else {                                        // 그 외의 Cell들
    pCanvas->Brush->Color = clWhite;
    pCanvas->Font->Color = clBlack;
  }

  int nLeft = Rect.Left + 2;
  int nTop  = Rect.Top + (Rect.Height() - pCanvas->TextHeight( "Hy" )) / 2;

  pCanvas->TextRect( Rect, nLeft, nTop, StringGrid1->Cells[ACol][ARow] );
  // pCanvas->DrawFocusRect( Rect );
}


evergreen 님이 쓰신 글 :
: StringGrid의 글자색은 Font의 Color로 변경할 수 있습니다.
: SG1->Canvas->Font->Color를 바꿔 보세요.
:
: 막막한초보 님이 쓰신 글 :
: : ManagerMain->SG1->Canvas->Brush->Color = clRed;
: :  ManagerMain->SG1->Canvas->Pen->Color   = clWhite;
: :  ManagerMain->SG1->Canvas->FillRect(ManagerMain->SG1->CellRect(nCol,nRow));
: :  ManagerMain->SG1->Canvas->TextRect(ManagerMain->SG1->CellRect(nCol,nRow),5,5,ConTxt);
: :
: : 이렇게 했는데요... 글씨가 안보여요..
: : 그 셀의  색만 빨강색으로 변하고... 글씨는 안보이네요...
: : 어떻게 해야 하죠... 쩝..

+ -

관련 글 리스트
41073 StringGeid 글씨가 안보여요,. 막막한초보 749 2005/07/15
41080     Re:StringGeid 글씨가 안보여요,. evergreen 741 2005/07/16
41081         Re:Re:StringGeid 글씨가 안보여요,. evergreen 1015 2005/07/16
41106             감솨 합니다. ^^ 냉무 막막한초보 713 2005/07/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.