Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CREATEOBJECT vs DO FORM.. NAME..
Message
De
15/04/2007 06:41:04
 
 
À
14/04/2007 19:59:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01215967
Message ID:
01216021
Vues:
19
>Hi Everybody,
>
>In my forms manager class, I use DO FORM myform NAME somename to manage instances of each of the form my apps uses.
>
>What I am attempting to do now is convert my forms (like frmCustomerDataEntry for example) into a class.
>
>So, instead of:
>
>
> DO FORM frmCustomerDataEntry NAME ofrmCustomerDataEntry
>
>
>I want to:
>
>
>ofrmCustomerDataEntry = CREATEOBJECT( "frmCustomerDataEntry" )
>ofrmCustomerDataEntry.Show()
>
>
>Problem is, it doesn't work quite well. It appears like a ghost then disappears right away if it's Show'n as Modeless. I have to Show it as Modal for it work ( ofrmCustomerDataEntry.Show(1) ). Modal is kinda not the way I would like it.
>
>Obviously, the form object variable loses scope. Declaring the var public wouldn't be 'elegant'.

Declaring it PUBLIC indeed isn't elegant, but declaring it PRIVATE in the MAIN program is 'legitimate' and common practice. See for my advice: A Private Global Variable Thread #669192 Message #669192


>Any help is appreciated. Or should I just leave it as DO FORM... NAME...?
>
>Thanks! Cheers!
>
>Dennis
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform