Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Muster für ListBox balken (https://www.delphipraxis.net/48449-muster-fuer-listbox-balken.html)

mimi 25. Jun 2005 13:42


Muster für ListBox balken
 
Hallo,
ich wüerde gerne den makierungs balken genau in der selben farbe haben wie die listbox und ein balken rand.
ich habe hier im forum gesucht und auch was gefunden nur wird leider kein rand-muster gezeichnet:
Delphi-Quellcode:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var
  str:String;
begin
  str:='';
  with ListBox1.Canvas do begin
    if odSelected in State then begin
      Brush.Color:=$00A80000;
      font.Color:=clYellow;

    end;
     
    FillRect(Rect);

    Font.Size := 8;   // use font's preferred size
    Font.Name:='MS Sans Serif';
    if Pos('$',Playliste[index+1]) >= 0 then begin
      if JvCheckbox1.Checked = True then begin
        if NumToken(Playliste[index+1],'$') > 6 then begin
          str:='*';
          Font.Color:=StringToColor(GetToken(Playliste[index+1],'$',6));
        end;
      end
      else
        if NumToken(Playliste[index+1],'$') > 2 then begin
          Font.Color:=StringToColor(GetToken(Playliste[index+1],'$',2));
          str:='';
        end;
    end;
    TextOut(Rect.Left+1, Rect.Top+1, ListBox1.Items[Index]+str);
    if (odFocused in state) then begin
      Brush.Style:=bsDiagCross;
      Pen.Style:=psDot;

      DrawFocusRect(rect);

    end;
  end;  
end;
jeder eintrag kann in eine andre farbe gezeichent werden, das geht auch schon, nur bei den if odFocused da gehts irgenwie leider nicht mehr so richtig. Die hintergrund farbe ist:
$00A80000
eine art dunkles Blau.


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:33 Uhr.

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