Einzelnen Beitrag anzeigen

mcrool2010

Registriert seit: 3. Dez 2010
7 Beiträge
 
#9

AW: FREE PASCAL- habe ein Problem-Passworrt Programm

  Alt 3. Dez 2010, 21:12
sdlo das sind alle 3Units:

Delphi-Quellcode:
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  Unit2, StdCtrls, Unit3;

type

  { TForm1 }

  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form1: TForm1;

implementation

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin

if Edit1.text ='passwort123then
   begin
    Form1.Hide;
    Form2.Show;
   end
else if Edit1.Text ='passwort1234then
   begin
   Form1.Hide;
   Form3.Show;
   end;
end;


initialization
  {$I unit1.lrs}

end.
Delphi-Quellcode:
unit Unit3;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls;

type

  { TForm3 }

  TForm3 = class(TForm)
    Label1: TLabel;
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form3: TForm3;

implementation

initialization
  {$I unit3.lrs}

end.
Delphi-Quellcode:
program project1;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}{$IFDEF UseCThreads}
  cthreads,
  {$ENDIF}{$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, Unit1, LResources, Unit2, Unit3
  { you can add units after this };



begin
  {$I project1.lrs}
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.Run;
end.
Delphi-Quellcode:
unit Unit2;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls;

type

  { TForm2 }

  TForm2 = class(TForm)
    Label1: TLabel;
  private
    { private declarations }
  public
    { public declarations }
  end;

var
  Form2: TForm2;

implementation

initialization
  {$I unit2.lrs}

end.
  Mit Zitat antworten Zitat