unit MAIN;
interface
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, Menus,
StdCtrls, Dialogs, Buttons, Messages, ExtCtrls, ComCtrls, StdActns,
ActnList, ToolWin, ImgList, IniFiles, XPMan, Commctrl, CheckLst;
type
TMainForm =
class(TForm)
.
.
.
public
constructor Create(AOwner: TComponent);
override;
.
.
.
procedure TMainForm.CreateMDIChild(
const Name:
string);
var
Child: TMDIChild;
begin
Child := TMDIChild.Create(Application);
Child.Caption :=
Name;
end;
////////Test
constructor TMainForm.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
ControlStyle := ControlStyle + [csAcceptsControls];
end;
//Ladezustandsanzeige//////
procedure TMainForm.DatenTimerTimer(Sender: TObject);
begin
Inc(Ctr, 2);
if Ctr>100
then Ctr:=0;
laPos.Caption:=IntToStr(Ctr);
end;
//Ladezustandsanzeige//
procedure TMainForm.Button1Click(Sender: TObject);
var
i: Integer;
dt: TDateTime;
begin
DatenTimer.Enabled:=false;
StatusBar.Hide;
paProgrStatus.Show;
paProgrStatus.Repaint;
try
for i:=0
to 100
do begin
dt:=Now;
while (Now-dt)<EncodeTime(0, 0, 0, 10)
do;
pbStatus.Position:=i;
laPos.Caption:=IntToStr(i);
paProgrStatus.Caption:=IntToStr(i);
paProgrStatus.Repaint;
laPos.Repaint;
end;
finally
paProgrStatus.Hide;
StatusBar.Show;
DatenTimer.Enabled:=true;
end;
end;
procedure TMainForm.FormShow(Sender: TObject);
var
r: TRect;
begin
StatusBar.Perform(SB_GETRECT, 0, Integer(@R));
paProgrStatus.Parent := Statusbar;
//Prog.Bar adoptieren
paProgrStatus.Top := r.Top;
//Größe der
paProgrStatus.Left := r.Left;
//Progressbar setzen
paProgrStatus.Width := r.Right - r.Left;
//und an Panel anpassen
paProgrStatus.Height := r.Bottom - r.Top;
end;