Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   TComboboxEx - Icons sind schwarz (https://www.delphipraxis.net/169542-tcomboboxex-icons-sind-schwarz.html)

FXL 28. Jul 2012 12:09

AW: TComboboxEx - Icons sind schwarz
 
@ConnorMcLeod

Vielen Dank für den Codeauszug, werd es am Montag gleich probieren.

Meinst du ".ico"?? - wenn ja, kein Problem, dann wandel ich die Bilder um.


Gruß

ConnorMcLeod 28. Jul 2012 13:03

AW: TComboboxEx - Icons sind schwarz
 
Nein, ich musste die Icons für bestimmte Extensions ermitteln. Nicht aus Grafikdateien auslesen, sondern von Windows anfordern.

FXL 30. Jul 2012 11:27

AW: TComboboxEx - Icons sind schwarz
 
So, habs heute hinbekommen, ka was falsch war, hab einfach nochmal neu angefangen und es hat funktioniert.

Hier der Quellcode (wenn noch jemand anders das selbe problem hat)

Code:
procedure TForm5.FormShow(Sender: TObject);
var
  combEx : TComboBoxEx;
  myImages : TImageList;
  image : TBitmap;
begin

  try  
    combEx := TComboBoxEx.Create(Self);
    combEx.Parent := Self;
    combEx.Visible := true;
    combEx.ItemHeight := 20;
    combEx.Style := csExDropDownList;

    combEx.Align := alLeft;
    combEx.DoubleBuffered := true;

    image := TBitmap.Create();

    myImages := TImageList.CreateSize(16, 11);
    image.LoadFromFile('Name.bmp');
    myImages.Add(image,nil);
    image.LoadFromFile('Name2.bmp');
    myImages.Add(image,nil);

    combEx.Images := myImages;

    combEx.ItemsEx.AddItem('1. Eintrag', 0, 0, -1, 0, nil);
    combEx.ItemsEx.AddItem('2. Eintrag', 1, 1, -1, 0, nil);

    combEx.ItemIndex := 0;

  except on E:Exception do begin
    MessageDlg(e.Message, mtWarning, [mbOK], 0);

  end;

  end;
end;

Gruß


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:58 Uhr.
Seite 2 von 2     12   

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