> and it worked very well, but now i have to put in the same form,
> another ComboBox and add new bitmaps and new texts. When the program
> runs, only one of the ComboBoxes display it's content (bitmap and
> text) and the other one only shows the text (why ?????)
Make sure the style of the second combo box is set to OwnerDraw.
> Other question (sorry my ignorance !!) is How to Wrap lines in
> ComboBoxes Items ???
OK, in the "show the text" thing, instead of
// Show the text
TextOut(Rect.Left + Offset, Rect.Top, ComboBos1.Items[Index])
try
// Show the text
Inc(Rect.Left, Offset);
DrawText((Control as TComboBox).Canvas.Handle, Rect,
PChar(ComboBos1.Items[Index]),
Length(ComboBos1.Items[Index]), DT_LEFT or DT_MULTILINE);
Something like that, anyway. Look up DrawText in your Win32 API for the
exact parameters (I'm not at home, so I can't check). Using DrawText
enables you to specify all sorts of neat things like vertical
justification, ellipsis (shortening the text if it doesn't all fit) and
so on - far more flexible than TextOut.
HTH
- Matt
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz