Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi Custom list item drawing (https://www.delphipraxis.net/147519-custom-list-item-drawing.html)

WojTec 10. Feb 2010 13:09


Custom list item drawing
 
I want to draw custom list. First line is bolded string, if is last item, should draw additional line in normal style, simple:

Delphi-Quellcode:
begin
  if Control is TCheckListBox then
  begin
    with TCheckListBox(Control) do
    begin
      Canvas.FillRect(Rect);

      Canvas.Font.Style := [fsBold];
      Canvas.TextOut(Rect.Left + 4, Rect.Top + 4, Items[Index]);

      if Index = Count - 1 then
      begin
        Canvas.Font.Style := [];
        Canvas.TextOut(Rect.Left + 4, Rect.Top + 21, OpenPictureDialog.FileName);
      end;
    end;
  end;
end;
But it's simple in theory only. This code changing font style only and drawind only Items[I] in default position. What to do to get result I want?

Luckie 10. Feb 2010 14:28

Re: Custom list item drawing
 
Sorry, but I don't get your problem.

WojTec 10. Feb 2010 17:57

Re: Custom list item drawing
 
Is not actual for now - I changed list to standard list box :)


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz