Ver Mensaje Individual
  #2  
Antiguo 04-12-2012
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
bulc,

Revisa esta imagen:



Revisa este código:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ImgList, ImgListBox, ImgComboBox, Buttons;

type
  TForm1 = class(TForm)
    ImgComboBox1: TImgComboBox;
    ImgListBox1: TImgListBox;
    ImageList1: TImageList;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure ImgListBox1Click(Sender: TObject);
    procedure ImgComboBox1Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
var
   i : Integer;
begin
   ImgListBox1.Clear;
   ImgListBox1.Images := ImageList1;
   for i := 0 to 4 do
   begin
      ImgListBox1.SetImageIndex(i,i);
      ImgListBox1.Items.Add('ImgListBox-'+IntToStr(i));
   end
end;

procedure TForm1.BitBtn2Click(Sender: TObject);
var
   i : Integer;
begin
   ImgComboBox1.Clear;
   ImgComboBox1.Images := ImageList1;
   for i := 0 to 4 do
   begin
      ImgComboBox1.SetImageIndex(i,i);
      ImgComboBox1.Items.Add('ImgComboBox-'+IntToStr(i));
   end
end;

procedure TForm1.ImgListBox1Click(Sender: TObject);
begin
   ShowMessage(ImgListBox1.Items.Strings[ImgListBox1.ItemIndex]);
end;

procedure TForm1.ImgComboBox1Change(Sender: TObject);
begin
   ShowMessage(ImgComboBox1.Items.Strings[ImgComboBox1.ItemIndex]);
end;

end.
El código anterior implementa los componentes freeware TImgComboBox y TImgListBox creados por Derek van Daal : derekvandaal@hotmail.com

El ejemplo y el componente se encuentran en el link: http://terawiki.clubdelphi.com/Delph...ImgListBox.rar

La información original fue obtenida del link: http://www.delphipages.com/comp/imag...ist_-4580.html

Espero sea útil

Nelson.

Última edición por nlsgarcia fecha: 04-12-2012 a las 21:58:42.
Responder Con Cita