Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about a public variable
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00285721
Message ID:
00285778
Vues:
15
>I have a form where I want some options to be displayed on the main menu. So I create a new menu pad from this form's init, and release the menu pad from the form's release method. I want to run one of the form's methods when a menu bar is selected from this new menu pad.
>
>I tried the following command: oThisform = thisform so that I could reference "thisform's" methods. I get the error oThisform does not exist. I assume that this is because the form has a private datasession.
>
>Anyway, I then declared oThisform to be public and then everything seems to work fine.
>
>My question is, is there a problem with doing this? Is this defeating the purpose of having the form in a private datasession? Or maybe I'm worrying about nothing and it is ok to do this and then release oThisform from within the form's release method?
>
>thanks,
>Paul

Don't create the menu in the Init. Do it in the Form.Activate. That way as you jump between forms, the menu will pop on and off properly. As Evan and Ed said, use _SCREEN.ActiveForm.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform