Ver Mensaje Individual
  #9  
Antiguo 27-02-2008
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 27
jachguate Va por buen camino
bueno... yo eso lo haría algo así:

Código Delphi [-]
var
  bmp: TBitmap;
  Indice: Integer;
begin
  case ListBox1.ItemIndex  of
    0:  Indice := 4;
    1:  Indice := 2;
    2:  Indice := 10;
    3:  Indice := 4;
    4:  Indice := 2;
    5:  Indice := 10;
    6:  Indice := 0;
    7:  Indice := 6;
    else Indice := 0;
  end;
  bmp := TBitmap.Create;
  try
    if ImageList1.GetBitmap(Indice, bmp) then
    begin
      bbtnComando.Glyph := bmp;
      bbtnComando.Caption := ListBox1.Items[ListBox1.ItemIndex];
    end
    else
    begin
      bbtnComando.Glyph := nil;
      bbtnComando.Caption := 'Error interno!';
    end;
  finally
    bmp.Free;
  end;

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita