Registriert seit: 21. Aug 2003
7.332 Beiträge
Delphi 2009 Professional
|
Re: Variablenübergabe - ich verzweifle
19. Apr 2008, 14:32
Hi,
ist mal aus dem Kopf getippt:
Delphi-Quellcode:
unit Main;
interface
uses
Sub, Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm3 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormMain: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
with TForm5.Create(Application) do
begin
try
MemoText := ' Das ist ein Test';
ShowModal;
finally
Free;
end;
end;
end;
end.
Delphi-Quellcode:
unit Sub;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm5 = class(TForm)
Memo1: TMemo;
private
{ Private declarations }
function GetMemoText: String;
procedure SetMemoText( const Value: String);
public
property MemoText: String read GetMemoText write SetMemoText;
end;
implementation
{$R *.dfm}
function TForm5.GetMemoText: String;
begin
Result := Memo1.Text;
end;
procedure TForm5.SetMemoText( const Value: String);
begin
Memo1.Text := Value;
end;
end.
|
|
Zitat
|