Registriert seit: 28. Apr 2008
Ort: Stolberg (Rhl)
6.659 Beiträge
FreePascal / Lazarus
|
AW: Probleme beim Zugreifen auf 2. Form
28. Jun 2013, 17:41
Wo ist das Problem:
Delphi-Quellcode:
program Project2;
uses
Forms,
Unit1 in ' Unit1.pas' {Form1},
Unit2 in ' Unit2.pas' {Form2};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.Run;
end.
(* *************************************** *)
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
label1.Caption:=' Labello1';
form2.label1.Caption:=' labello2';
form2.show;
end;
end.
(* ********************************************************* *)
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Label1: TLabel;
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.
funktioniert!
Gruß
K-H
Programme gehorchen nicht Deinen Absichten sondern Deinen Anweisungen
R.E.D retired error detector
|
|
Zitat
|