Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CREATEOBJECT vs DO FORM.. NAME..
Message
De
16/04/2007 02:24:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01215967
Message ID:
01216119
Vues:
21
Naomi,

I do have an array that holds object references to each form that opens.

It works quite well I must say, but not when I issue
ofrmCustomerDataEntry = CREATEOBJECT( "frmCustomerDataEntry" )
ofrmCustomerDataEntry.Show()
The above will just see the form appear and disappear right away.

It works well if I use my 'old' way of:
DO FORM frmCustomerDataEntry NAME ofrmCustomerDataEntry
>You can have an array property in your form manager class and have this array property hold a reference to each open form. When you done with the form, you should set this array element to NULL.
>
>That's an idea, I need to check on Monday at work how do I manage this problem in my form's manager class.
>
>>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'.
>>
>>Any help is appreciated. Or should I just leave it as DO FORM... NAME...?
>>
>>Thanks! Cheers!
>>
>>Dennis
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform