Einzelnen Beitrag anzeigen

EDatabaseError

Registriert seit: 11. Mai 2005
Ort: Göppingen
1.238 Beiträge
 
Delphi 2007 Professional
 
#1

ProgressBar, Shape ... in einer Statusbar einbinden?

  Alt 30. Jul 2006, 13:42
Ich habe hier von den Schweizern folgenden Code mit dem man eine Progressbar und andere VCL Komponenten in eine Statusbar einbinden kann:

Delphi-Quellcode:
uses
  CommCtrl;

type
  THackControl = class(TControl);

procedure TForm1.FormCreate(Sender: TObject);
var
  PanelRect: TRect;
begin
  // Place progressbar on the statusbar
  THackControl(ProgressBar1).SetParent(StatusBar1);
  // Retreive the rectancle of the statuspanel (in my case the second)
  SendMessage(StatusBar1.Handle, SB_GETRECT, 1, Integer(@PanelRect));
  // Position the progressbar over the panel on the statusbar
  with PanelRect do
    ProgressBar1.SetBounds(Left, Top, Right - Left, Bottom - Top);
end;
Statt Progressbar1 kann da auch Shape1 ... stehen.

Mfg
Tobi
Tobias
It's not a bug, it's a feature.
  Mit Zitat antworten Zitat