|
김윤동.제라툴 님이 쓰신 글 :
: 안녕하십니까? 제라툴입니다.
:
: 제가 생각하는것이 맞다면 ...
:
: TComboBox에서 Style를 csOwnerDrawFixed 로 바꾸고
:
: OnDrawItem에서 처리해주는 방법으면 해결될것 같습니다.
:
: 간단히 코드를 만들면...
:
: void __fastcall TForm1::ComboBox1DrawItem(TWinControl *Control, int Index,
: TRect &Rect, TOwnerDrawState State)
: {
: TComboBox *pComboBox = dynamic_cast<TComboBox*>(Control);
: if ( pComboBox == NULL ) return;
:
: if ( State.Contains( odComboBoxEdit ) )
: {
: pComboBox->Canvas->Brush->Color = clWhite;
: pComboBox->Canvas->FillRect(Rect);
: pComboBox->Canvas->Font->Color = clBlack;
: pComboBox->Canvas->TextOut(Rect.Left + 2, Rect.Top, ComboBox1->Items->Strings[Index]);
: }
: else
: {
:
: pComboBox->Canvas->FillRect(Rect);
: pComboBox->Canvas->TextOut(Rect.Left + 2, Rect.Top, pComboBox->Items->Strings[Index]);
: }
:
: }
:
: 좋은 하루 되십시오
: From Zeratul
:
와우 원하던 답변을 해줘서 정말 감사^^
|