Ver Mensaje Individual
  #2  
Antiguo 06-09-2006
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Prueba con este procedimento:

Código Delphi [-]
procedure SetHorizontalScrollBar(ListBox: TListBox);
var
  W, I: Integer;

begin
  with ListBox do
  begin
    W := ClientWidth;

    for I := 0 to Items.Count - 1 do
      if W < Canvas.TextWidth(Items[i]) then
        W := Canvas.TextWidth(Items[i]);

    if W > ClientWidth then
      Inc(W, 4);

    Perform(LB_SETHORIZONTALEXTENT, W, 0);
  end;
end;

Tendrías que aplicar este procedimiento cada vez que hagas un cambio en el ListBox.

// Saludos
Responder Con Cita