|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Joern
Newbie

Offline
Beiträge: 44

|
 |
« Antworten #17 am: 26.09.2002, 14:23:01 » |
|
Auch eine Möglichkeit...
[font size=2 face="Courier New" color="#000000"]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 [font color="#000080"]{ Private declarations } [/font]Fa : Integer; procedure SetA(aa : Integer); public [font color="#000080"]{ Public declarations } [/font]b : Integer; property a : Integer read Fa write SetA; end;
var Form1: TForm1;
implementation
procedure TForm1.SetA(aa : Integer); begin b := aa; Fa := aa; end;
[font color="#000080"]{$R *.dfm}
[/font]procedure TForm1.Button1Click(Sender: TObject); begin a := 4711; ShowMessage('a = '+IntToStr(a)+#13#10+'b = '+IntToStr(b)); end;
end.
[/font]
Gruss, Jörn
|
|
|
|
|
Gespeichert
|
|
|
|
Meister
Jr. Member
 
Offline
Beiträge: 64

|
 |
« Antworten #18 am: 28.09.2002, 16:23:47 » |
|
Auf der Endlosen suche nach der lösung für diese Problem bin ich hie drauf gestoßen: 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 declarations }
procedure OnIdle(Sender: TObject; var Done: Boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
a, b : Integer;
implementation
{$R *.dfm}
procedure TForm1.OnIdle(Sender: TObject; var Done: Boolean);
begin
b := a;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnIdle := OnIdle;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
a := 12;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage('a = '+IntToStr(a)+#13#10+'b = '+IntToStr(b));
end;
end.
was mein Ihr, wenn man erst button1 drückt und dann Button2 was steht dann wohl in der Messagebox?
|
|
|
|
|
Gespeichert
|
Wozu das Rad neu Implementieren?
|
|
|
|
|