Edit.OnExit versus Button.OnClick

From: RA (robert_ankka_at_hotmail.com.invalid)
Date: 12/23/04


Date: Thu, 23 Dec 2004 22:15:28 +0200

An Edit Box has OnExit event and a Button has OnClick event. When the button
is clicked the Edit Box is exited. But how could we know inside the OnExit
event that this certain Button has been clicked? If a global variable is set
in the Button OnClick event, its actual value is not known in the OnExit
event.

var button1clicked :boolean;

procedure TForm1.FormCreate(Sender: TObject);
begin
   buttonclicked:=false;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
     buttonclicked:=true;
end;

procedure TForm1.Edit1Exit(Sender: TObject);
begin
     if buttonclicked then ... // here buttonclicked is not true
end;


Quantcast