From 61831ae8288d2da0bd5b6cd4283796b2c797b34a Mon Sep 17 00:00:00 2001 From: graemeg Date: Tue, 15 Apr 2008 11:59:17 +0000 Subject: * Minor update to the modalform demo. --- examples/gui/modalforms/modalforms.lpr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/gui/modalforms/modalforms.lpr b/examples/gui/modalforms/modalforms.lpr index 546c4f12..188985e9 100644 --- a/examples/gui/modalforms/modalforms.lpr +++ b/examples/gui/modalforms/modalforms.lpr @@ -99,11 +99,12 @@ procedure TForm1.btnOpenForm2Click(Sender: TObject); var frm: TForm2; begin + frm := TForm2.Create(nil); try - frm := TForm2.Create(nil); frm.ShowModal; writeln('Form2: This should only appear after the form closes.'); edtTest.SetFocus; + ActivateWindow; finally frm.Free; end; @@ -143,10 +144,11 @@ procedure TMainForm.btnOpenForm1Click(Sender: TObject); var frm: TForm1; begin + frm := TForm1.Create(nil); try - frm := TForm1.Create(nil); frm.ShowModal; writeln('Form1: This should only appear after the form closes.'); + ActivateWindow; finally frm.Free; end; -- cgit v1.2.3-70-g09d2