Recent

Author Topic: Problem with form to be called with ShowModal  (Read 8798 times)

Noodly

  • Jr. Member
  • **
  • Posts: 70
Re: Problem with form to be called with ShowModal
« Reply #15 on: February 24, 2016, 03:25:50 pm »
@getmem

I believe that assigning form2.PopupParent:=form1 solves the OPs problem in the example he gave, but whether or not there is a more fundamental underlying Z order issue with modal forms is another question.
Windows 10 Home, Lazarus 2.02 (svn 60954), FPC 3.04

Ever

  • Jr. Member
  • **
  • Posts: 61
Re: Problem with form to be called with ShowModal
« Reply #16 on: February 24, 2016, 04:50:33 pm »
I solved the problem by following the advice of placing form2 PopupParent: = Form1. Forget to mention that use Windows 10.

Thank you all for your cooperation

FTurtle

  • Sr. Member
  • ****
  • Posts: 292
Re: Problem with form to be called with ShowModal
« Reply #17 on: February 24, 2016, 10:41:30 pm »
I solved the problem by following the advice of placing form2 PopupParent: = Form1.

Other way:
Set for TForm2 in designer: PopupMode:=pmAuto

I think this way is better, because it works for all instances of TForm2 and does not require an explicit code for each call.
In general, PopupParent should not be set in designer because:
1. Different forms (classes and instanses) may call this form.
2. Global variable may be not used at all.

 

TinyPortal © 2005-2018