[Lazarus] Modal forms: block parent form or application

Paul Ishenin webpirat at mail.ru
Sat Jan 29 10:47:45 CET 2011


29.01.2011 15:29, cobines wrote:
> Hello,
>
> I have two forms Form1 and Form2. Form1 is MainForm with
> ShowInTaskbar=stDefault and Form2 has ShowInTaskbar=True, so they both
> have taskbar buttons, I treat them as separate windows. I show a modal
> form from Form2 which blocks the whole application. Is it possible to
> have it block only Form2, so I can still activate and work in Form1?
Yes. You don't need a modal form then.

1. Change your modal form to be a regular form with PopupParent = Form2.
2. Disable Form2 when you show your popup form.

Of course the logic requires a small reimplementation because you can't 
use ModalResult and Show is not a blocking method as ShowModal.

Best regards,
Paul Ishenin




More information about the Lazarus mailing list