Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Access & Assign ok with OLEControl?
Message
 
 
À
22/10/2001 14:22:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00571710
Message ID:
00571798
Vues:
24
>>>I'm trying to set the default value through the property sheet - that's the ideal method - one place to look.
>>
>>With Access and Assign methods, that isn't necessarily the case. Assign methods don't fire if the property is set via the Property Sheet. In order to have it fire, you need to add code to the Init to set the Value to itself.
>
>That's true - but when I drop the control onto a form in development mode I don't want to have to go back and set displayonly from True to False - If it can be set through the property sheet when designing the class, THAT would be ideal. When the control executes, I definately want it to run through the methods.
>

Add code to your class in the Init to assign whatever properties that you have Assign methods for to themselves (I do this for my ImageList and TreeView classes). If you do add code to the Init of any instance/subclass, be sure to issue a DODEFAULT() to make sure your code fires.

>>As for your error, I was able to duplicate it setting only the Access method. This may be a bug (not sure). Do you need the Access method for your purposes?
>
>I'm only interested in the Assign method, but have been in the habit of including the matched set. Wasn't there an issue (bug) that arose if you didn't include both? It appears as if you specify both methods VFP (6 & 7) sets the property to TRUE and ignores any default value. I'm starting to think that VFP is trying to be helpful but screwing me up in the process.
>

I never heard of a bug about that. Do you remember where you heard/read it? I rarely check both.

Most of the time, I only use the Access method for something like THIS_ACCESS. I use this for my OLE controls. It usually returns an object reference to THIS.Object instead of THIS. Some OLE controls are finicky if you don't use the Object reference.

I have used the Assign method on many occasions without having an Access method.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform