Registriert seit: 22. Sep 2004
Ort: Hannover
1.807 Beiträge
Delphi 10.2 Tokyo Starter
|
Re: Procedures aus anderen Forms aufrufen
23. Jan 2005, 19:32
Hallo hier meine Units:
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
procedure Hallo;
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses
Unit2;
procedure TForm1.Hallo;
begin
ShowMessage(' Hallo!');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.ShowModal;
end;
end.
Delphi-Quellcode:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
uses
Unit1;
procedure TForm2.Button1Click(Sender: TObject);
begin
Form1.Hallo;
end;
end.
Ich hoffe das lößt dein Problem.
MfG
freak
Christian
IT: Schließen Sie bitte das Fenster. User: Die Tür auch?
i++; // zaehler i um 1 erhoehen
|
|
Zitat
|