Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subclassing ActiveX control
Message
 
 
À
04/01/2005 14:14:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
00974138
Message ID:
00974176
Vues:
30
Hi Hank,

Thanks a lot for your help. Doing it this way, would I be able to add my own methods to this control and my own properties?

I already created a container class with the control added to it. I created SetDates and ValidateDate methods. In the LostFocus event I put
LOCAL ltDate as datetime
ltDate = CTOT(DTOC(DATE(1900,1,1) - 2 + THIS.DatePicker.DATE) + " 07:00:00 AM")

IF this.ValidateDate(m.ltDate)
   this.SetDates (m.ltDate)
ELSE
   NODEFAULT && prevent focus from leaving this control
endif
However, it doesn't seem to work and the focus still goes to another object. The other problem is that I want to fire my validation immediatelly when the user selected a date from the Calendar portion of this control and I am not sure, which method to use and how to fire this validation only once. The ctDateDrop control has only few methods. I already figured, that Change method doesn't serve my goal, since it fires every time I try to type something in the date portion.

May be you have experience with this particular control and know how to work around it? Or have other ideas?

Thanks a lot again.

>from the command window: CREATE CLASS
>
>in the Class Create dialog: pick a subclass name, select OleControl as the BasedOn, and for StoreIn indicate an existing or new VCX.
>
>When you click OK, you will be asked to select a control (in later versions it defaults correctly to Insert Control). Pick your control.
>
>This lets you subclass the events, etc. The disadvantage is that when the GUID changes (typically when the Interfaces have changed), you lose everything, unless you follow the instructions on the dbi site for moving the new COM code over.
>
>You will also find that ActiveX controls have a life of their own which is on a different diurnal pattern than VFP forms: they SHOW before the ACTIVATE, and bring the form with them. Various solutions, such as David LeMesurier's in the downloads section, have been proposed.
>
>Hank
>
>>Hi everybody,
>>
>>I am wondering if there is a way to subclass an ActiveX control besides adding it to a form? How can I do it visually with a container? We want to subclass a DbiTech ctDropDate control in order to add two new methods (Validate and SetDates), but we could not figure out the simple way to subclass this control.
>>
>>
>>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform