Ver Mensaje Individual
  #2  
Antiguo 22-02-2007
Avatar de seoane
[seoane] seoane is offline
Miembro Premium
 
Registrado: feb 2004
Ubicación: A Coruña, España
Posts: 3.717
Reputación: 24
seoane Va por buen camino
En el evento OnDrawPanel del TStatusBar pon algo como esto:
Código Delphi [-]
procedure TForm2.StatusBar1DrawPanel(StatusBar: TStatusBar; Panel: TStatusPanel;
  const Rect: TRect);
var
  i: integer;
  R: TRect;
begin
  // Aqui coloca el nuemro del panel que se va a comportar como ProgressBar
  // yo voy a usar el 0
  if StatusBar.Panels[0] = Panel then
    if TryStrToInt(Panel.Text,i) then
    begin
      StatusBar.Canvas.FillRect(Rect);
      R:= Rect;
      StatusBar.Canvas.Brush.Color:= clNavy;
      R.Right:= R.Left + (((R.Right - R.Left)*i) div 100);
      StatusBar.Canvas.FillRect(R);
    end;
end;

En la propiedad Style del panel coloca psOwnerDraw. Ahora ya solo tienes que escribir en la propiedad Text del panel un numero del 1 al 100, y la barra de se dibujara. Es decir, para poner 50 en la barra:
Código Delphi [-]
   StatusBar1.Panels[0].Text:= '50';
Responder Con Cita