[Lazarus] How to minimize application showing modal form(s)

Howard Page-Clark hdpc at talktalk.net
Sat Apr 12 19:13:08 CEST 2014


On 12/04/2014 17:06, Frank Poretzky wrote:
> Is there a way to modify my modal form to get it minimized as well?

Create your modal form with the main form as its owner, and give it a 
unique Name at creation.
In your main form's declaration set up two Application handlers, 
OnMinimize and OnRestore (of type TNotifyEvent), and hook them up in 
your main form's OnCreate code.
In the OnMinimize and OnRestore handler implementations use 
FindComponent (or some other means) to locate your previously named 
modal form, and either Hide it or Show it as appropriate.

Howard





More information about the Lazarus mailing list