Einzelnen Beitrag anzeigen

Eazel

Registriert seit: 12. Sep 2010
9 Beiträge
 
Delphi 5 Professional
 
#10

AW: Button soll Programm neustarten

  Alt 12. Sep 2010, 16:51
ok also ich poste jetztmal alles:

Delphi-Quellcode:
unit pHelloWorld;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ComCtrls, ExtCtrls;

type
  THelloWorld = class(TForm)
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    Button8: TButton;
    Timer1: TTimer;
    ProgressBar1: TProgressBar;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Button1: TButton;
    procedure Button5Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button8Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  HelloWorld: THelloWorld;

implementation

{$R *.DFM}

procedure THelloWorld.Button5Click(Sender: TObject);
begin
HelloWorld.Color := clblue;
HelloWorld.caption := 'Blau';
Button5.Visible := false;
Button7.visible := true;
end;

procedure THelloWorld.Button7Click(Sender: TObject);
begin
HelloWorld.color := clgreen;
HelloWorld.caption := 'Grün';
Button7.visible := false;
Button2.visible := True;
Button6.visible := true;
Button3.visible := true;
Button8.visible := true;
Button4.visible := true;

end;

procedure THelloWorld.Button4Click(Sender: TObject);
begin
 Button2.Visible := false;
 Button6.visible := false;
 Button3.visible := false;
 Button8.Visible := false;
 Button4.visible := false;
 HelloWorld.caption := 'Glückwunsch';
 Timer1.Enabled := true;
 ProgressBar1.Visible := true;
 Label1.visible := true;
 Label2.visible := true;

end;

procedure THelloWorld.Timer1Timer(Sender: TObject);
begin
ProgressBar1.Position := ProgressBar1.Position+1;
if ProgressBar1.Position=100 then close;
end;

procedure THelloWorld.Button6Click(Sender: TObject);
begin
Label3.visible:= true;
Button2.Visible := false;
Button3.visible := false;
Button8.Visible := false;
Button4.Visible := false;
Button6.visible := false;
Label4.visible := true;
Button1.visible := true;

end;

procedure THelloWorld.Button3Click(Sender: TObject);
begin
      Label3.visible:= true;
Button2.Visible := false;
Button3.visible := false;
Button8.Visible := false;
Button4.Visible := false;
Button6.visible := false;
Label4.visible := true;
Button1.visible := true;
end;

procedure THelloWorld.Button8Click(Sender: TObject);
begin
Label3.visible:= true;
Button2.Visible := false;
Button3.visible := false;
Button8.Visible := false;
Button4.Visible := false;
Button6.visible := false;
Label4.visible := true;
Button1.visible := true;
end;

procedure THelloWorld.Button2Click(Sender: TObject);
begin
Label3.visible:= true;
Button2.Visible := false;
Button3.visible := false;
Button8.Visible := false;
Button4.Visible := false;
Button6.visible := false;
Label4.visible := true;
Button1.visible := true;

end;

procedure THelloWorld.Button1Click(Sender: TObject);
begin
HelloWorld.Close;
end;

end.
[edit=Matze][delphi]-Tags eingefügt. Zukünftig bitte selbst daran denken. MfG Matze[/edit]

Geändert von Matze (12. Sep 2010 um 16:54 Uhr)
  Mit Zitat antworten Zitat