Board index » cppbuilder » VCL ComboBox with Hints
romuald
![]() CBuilder Developer |
romuald
![]() CBuilder Developer |
VCL ComboBox with Hints2005-11-08 03:13:26 AM cppbuilder89 I need generate a VCL ComboBox with whints for every Item in ComboBox, and the Hint must appear every time I have highlighted one item from ComboBox, not only when I have selected a Item, it works on ListBox and other components but not in a ComboBox. By the way VCL ComboBox componet hasn't a OnHighlighted Event or similar, it exist only in CLX ComboBoxComponent. Thanks, Romuald Lobos |
davichu
![]() CBuilder Developer |
2005-11-08 03:35:09 AM
Re:VCL ComboBox with Hints
There is a method called ItemAtPos for the TListBox component, but doesn't
exist in the Combo Box. davichu "romuald" < XXXX@XXXXX.COM >escribi?en el mensaje QuoteI need generate a VCL ComboBox with whints for every Item in ComboBox, and |
Pete Fraser
![]() CBuilder Developer |
2005-11-08 03:51:53 AM
Re:VCL ComboBox with Hints
"romuald" < XXXX@XXXXX.COM >wrote in message
QuoteI need generate a VCL ComboBox with whints for every Item in ComboBox, and That way you would have a hint for each item in the list box. HTH Pete {smallsort} |
JD
![]() CBuilder Developer |
2005-11-08 04:12:37 AM
Re:VCL ComboBox with Hints
"romuald" < XXXX@XXXXX.COM >wrote:
Quote
{ ComboBox1->Style = csOwnerDrawFixed; } //------------------------------------------------------------- void __fastcall TForm1::ComboBox1DrawItem(TWinControl *Control, int Index, TRect &Rect, TOwnerDrawState State) { TComboBox *pBox = dynamic_cast<TComboBox*>( Control ); TCanvas *pCanvas = pBox->Canvas; if( State.Contains(odSelected) ) { pCanvas->Brush->Color = clHighlight; pCanvas->Font->Color = clHighlightText; Hint = ComboBox1->Items->Strings[Index]; } else { pCanvas->Brush->Color = pBox->Color; pCanvas->Font->Color = pBox->Font->Color; } pCanvas->FillRect( Rect ); pCanvas->TextOut( .... ); } //------------------------------------------------------------- ~ JD |