AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Liste

Ein Thema von daredd · begonnen am 4. Mai 2007 · letzter Beitrag vom 4. Mai 2007
Antwort Antwort
daredd

Registriert seit: 2. Apr 2006
433 Beiträge
 
#1

Liste

  Alt 4. Mai 2007, 13:17
Tag, hab noch eine Frage.
Ich habe ne liste mit mehrern komponenten, und nun wenn ich mit der maus auf eine komponente gehe also selecte, wird die die zeile der mit blau markiert, die standart farbe in windows für selected objecte.
Ich will aber meine eigene farbe benutzen, bis jetzt habe ich nichts gefunden (property) wo man das ändern könnte. hat da schon jemand erfahrung???
  Mit Zitat antworten Zitat
Blackheart

Registriert seit: 4. Mai 2005
846 Beiträge
 
Delphi 7 Enterprise
 
#2

Re: Liste

  Alt 4. Mai 2007, 13:35
Ich schätze mal Du meinst Listbox und Items, dann schau mal nach ListBox1DrawItem und Canvas.FillRect da sollest Du hier im Forum einiges zu Finden.
Blackheart
  Mit Zitat antworten Zitat
daredd

Registriert seit: 2. Apr 2006
433 Beiträge
 
#3

Re: Liste

  Alt 4. Mai 2007, 14:18
Delphi-Quellcode:
if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Font.Color := clBlack
             else begin
                Font.Color := Colors[TMSchemeItem(CLB.Items.Objects[Index]).IndGrp mod 16];
                Brush.Color := clwhite;
             end;
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Brush.Color := $00A9EBEB
             else begin
             Brush.Color := clwhite;
             end;
hier noch mal das gesammte:
Delphi-Quellcode:
procedure TpfFormPolling.clbSchemeDrawItem(Control: TWinControl;
  Index: integer; Rect: TRect; State: TOwnerDrawState);
var
   CLB : TCheckListBox;
   RectSize : integer;
   Item : TMSchemeItem;
begin
     CLB := (Control as TCheckListBox);
     with CLB.Canvas do begin
          Font.Name := 'Arial';
          FillRect(Rect);
          RectSize := Rect.Bottom - Rect.Top;
          Item := TMSchemeItem(CLB.Items.Objects[Index]);
          if Item.Grayed then begin
             Font.Color := clBlack;
             TextOut(Rect.Left + RectSize + 3, Rect.Top + 3, CLB.Items[Index]);
             Font.Color := clBlack;
             TextOut(Rect.Left + RectSize + 2, Rect.Top + 2, CLB.Items[Index]);
          end else begin
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Font.Color := clBlack
             else begin
                Font.Color := Colors[TMSchemeItem(CLB.Items.Objects[Index]).IndGrp mod 16];
                Brush.Color := clwhite;
             end;
             if ((State = [odSelected]) or (State = [odSelected,odFocused])) then Brush.Color := $00A9EBEB
             else begin
             Brush.Color := clwhite;
             end;
             if (Item.ItemType = rtMoraTherapy) or (Item.ItemType = rtVegetotest) then Font.Style := [fsItalic]
             else Font.Style := [];
             TextOut(Rect.Left + RectSize + 2, Rect.Top + 2, CLB.Items[Index]);
             if Item.Passed then begin
                Brush.Color := $0041D3D9; Brush.Style := bsSolid; Pen.Color := clBlack;
                Ellipse(Rect.Left + 5, Rect.Top + 5, Rect.Left + RectSize - 5, Rect.Bottom - 5);
                if (Item.StatInfo.cTotal = 0) then begin
                   ColorList.LoadStatInfoFromField(GetFieldFromIssled(Item.IndIssl));
                   Item.StatInfo := ColorList.StatInfo;
                end;
                Brush.Color := ColorForListsStatInfo(Item.StatInfo);
                Pen.Color := clBlack;
                Brush.Style := bsSolid;
                Ellipse(Rect.Left + 4, Rect.Top + 4, Rect.Left + RectSize - 6, Rect.Bottom - 6);
                if (Item.StatInfo.cRegion > 0) then begin
                   Brush.Style := bsClear;
                   Pen.Width := 1;
                   Rectangle(Rect.Left + 1, Rect.Top + 1, Rect.Left + RectSize - 3, Rect.Bottom - 3);
                end;
             end;
          end;
     end;
end;
Das ist mein code für Das DrawItem der liste, im angehang (downloads) seht ihr was bei mir raus kommt.
Der mach nicht das gesammte feld in der Farbe die ich will.
Was kann ich da machen????
Miniaturansicht angehängter Grafiken
drawitem_207.jpg  
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23: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