Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing a modal form
Message
De
27/05/2023 12:14:26
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01686646
Message ID:
01686668
Vues:
39
>>>>>Hi,
>>>>>
>>>>>Can you programmatically close a modal form when a user clicks anywhere outside the form?
>>>>
>>>>Shouldn't form's .deactivate() event fire then?
>>>
>>>When making the form modeless, clicking outside the form indeed closes the form. And I can determine that the form .deactivate is called.
>>>Do you suggest to set the form reference to NULL in deactivate()? So that not to have what I believe is called "dangling" references?
>>>
>>>UPDATE. The code that runs upon a user clicking on a button of the menu form, is based on the form tag value. That is, the tag is set to '1' when user clicks on the 1st button, and so on.
>>>Now, when the form is deactivated, the value of Tag is gone.
>>>How do I pass the value of selected button to the called method?
>>
>>Old trick... you instantiate the form from a class and assign to a variable. Then have your buttons only .hide() the form, not close it. Then in the calling code you still have a reference to your form, can access its properties. Then you can release the variable when done (or if it's a local one, do nothing, it'll release when the code exits).
>
>The above scenario works if the form is Modal. But if the form is Modeless, the deactivate closes the form. And .Tag value is lost.
>Am I misunderstanding what you wrote?

Covered that case in some other reply few minutes ago.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform