Witam :)
Chce uzyskac takie cos:
Mam listBox'a i kazdy item chce aby mial w tle np bitmape jakas tam ;P napisalem ale cos jest zle: napisy znikaja i pojawia sie tylko ten aktualnie klikniety [glowa]
procedure TForm1.ListaDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
BMP: TBitmap;
x,y: Byte;
begin
BMP := TBitmap.Create;
try
BMP.LoadFromFile('image2.bmp');
for x := 0 to (Lista.Width) do
for y := 0 to (Lista.Count - 1) do
Lista.Canvas.Draw(x * BMP.Width, y * BMP.Height, BMP);
finally
BMP.Free;
end;
if odSelected in State then begin
Lista.Canvas.Brush.Style:= bsClear;
end else begin
Lista.Canvas.Brush.Style:= bsClear;
end;
Lista.Canvas.Font.Name := 'Comic Sans MS';
Lista.Canvas.Font.Size := 10;
Lista.Canvas.Font.Style := [fsBold];
Lista.Canvas.Font.Color := $00F1954C;
Lista.Canvas.TextRect(Rect, Rect.Left + 5 , Rect.Top + 2 , Lista.Items.Strings[Index]);
Lista.Canvas.Font.Name := 'Verdana';
Lista.Canvas.Font.Size := 7;
Lista.Canvas.Font.Style := [];
Lista.Canvas.Font.Color := clBlack;
Lista.Canvas.TextRect(Rect, Rect.Left + 10, Rect.Top + 20, 'Kolejna linia ;)');
end;
Za cenne wskazowki serdecznie dziekuje ;)