Zlo, Эгм, а листбокс что не многострочный? Иконки рисуются например так:
| Код | procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); var Bitmap: TBitmap; Offset: Integer; BMPRect: TRect; begin with (Control as TListBox).Canvas do begin FillRect(Rect); Bitmap := TBitmap.Create; ImageList1.GetBitmap(4, Bitmap); Offset := 0; if Bitmap <> nil then begin BMPRect := Bounds(Rect.Left+2, Rect.Top+2, (Rect.Bottom-Rect.Top-2), Rect.Bottom-Rect.Top-2); BrushCopy(BMPRect,Bitmap, Bounds(0, 0, Bitmap.Width, Bitmap.Height), Bitmap.Canvas.Pixels[0, Bitmap.Height-1]); Offset := (Rect.Bottom-Rect.Top+1)+3; end; TextOut(Rect.Left+Offset, Rect.Top+2, ListBox1.Items[index]); Bitmap.Free; end; end;
|
В ДРКБ, полно статей, на эту тему...Да и на форуме поднимались вопросы не раз... |