To Cetin
>1) Create a dummy in-top-level form (small and out of visible area). Call that passing modeless toplevel form's name. It calls toplevel form and provides 'modality'
>
>2) A timer control which is enabled to track toplevel called. Code that should run after return should be in a different method. Timer calls that method and disables itself when toplevel unloads.
>
>3) Put 'OnReturn' code to a custom method. Pass thisform to called toplevel. Called calls oCaller.OnReturn in unload.
I stumbled on this old thread. I have a similar requirement and I have done the following:
- Created a Loader form with WindowType: Modal and ShowWindow: 1 In Top-Level Form (have also tried 0)
- Currently this is simple with a command button with THISFORM.Release() in it's click
- This in turns calls the actual Top-Level Form that I want to have Modal
- Top-Level form has ShowWindow: 2 As Top-Level Form
- This form has a child form (if it matters)
- Child form has ShowWindow: 1 In Top-Level form
What is happening is that the Loader form is displayed OK. The Top-Level+Child forms are then displayed for a blink and they go behind the application window.
I click the task bar icon a couple of times and the Top-Level+Child forms appear as they should.
Then if I move the Top-Level+Child form a bit, using the mouse drag of the caption, after a few clicks I am able to click on main applications controls and the Load form disappears and the Top-Level+Child forms go one again behind the main application window.
Please advise.