AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Combobox mit Icons Darstellung nicht korrekt

Ein Thema von Chemiker · begonnen am 26. Mai 2007 · letzter Beitrag vom 27. Mai 2007
 
Benutzerbild von bitsetter
bitsetter

Registriert seit: 17. Jan 2007
1.169 Beiträge
 
Turbo Delphi für Win32
 
#3

Re: Combobox mit Icons Darstellung nicht korrekt

  Alt 26. Mai 2007, 18:29
Hi,

das kommt weil der ItemIndex beim Aufklappen der Combobox -1 und nicht 0 oder 1 ist.
Eventuell könntest du es so abändern:
Delphi-Quellcode:
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  Combobox1.Canvas.Brush.Color:= clWhite;
  Combobox1.Canvas.FillRect(rect);
    if Index(*ComboBox1.ItemIndex *)= 0 then
    begin
      ImageList1.Draw(ComboBox1.Canvas, rect.Left+2, rect.Top+3,1);
    end;
    if Index(*ComboBox1.ItemIndex*) = 1 then
    begin
      ImageList1.Draw(ComboBox1.Canvas, rect.Left+2, rect.Top+3,0);
    end;
  ComboBox1.Canvas.Font.Color:= clblack;
  ComboBox1.Canvas.TextOut(32,rect.Top+4,Combobox1.Items[index]);
end;
Dann allerdings ohne ItemIndex.
Gruß bitsetter
"Viele Wege führen nach Rom"
Wolfgang Mocker (geb. 1954), dt. Satiriker und Aphoristiker
  Mit Zitat antworten Zitat
 


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 00:19 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