Einzelnen Beitrag anzeigen

Acuaplano

Registriert seit: 8. Mai 2013
29 Beiträge
 
#12

AW: Probleme beim Zugreifen auf 2. Form

  Alt 28. Jun 2013, 16:15
Ich hab's eben nochmal mit einem neuen Projekt probiert und entweder ist mein Lazarus verbuggt oder ich mache was falsch:
Neues Projekt erstellt - 2 Formulare - Zweites Formular in's erste eingebunden - Button und Labels darauf platziert und gleiches Problem: tut sich nix

Delphi-Quellcode:
unit Unit1;

{$mode objfpc}{$H+}

interface

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

type

  { TForm1 }

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

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.Label1.Caption := 'Form2';
  Label1.Caption := 'Form1';

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Form2 := TForm2.Create(self);
  Form2.Show;
end;

end.
Delphi-Quellcode:
unit Unit2;

{$mode objfpc}{$H+}

interface

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

type

  { TForm2 }

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

var
  Form2: TForm2;

implementation


{$R *.lfm}

end.
Irgendwas muss ich doch falsch gemacht haben
  Mit Zitat antworten Zitat