Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing a modal form
Message
 
 
À
27/05/2023 12:10:08
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:
01686669
Vues:
29
>>>>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).

Sorry I am not getting it. Again, in my case - now - the popup form is MODELESS. As soon as the code in this, POPUP MODELESS form, calls .hide(), the method DEACTIVATE is fired. And therefore, the .tag is gone. That is, as soon as hide() fires, the code (in the debugger) goes to the READ EVENTS line.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform