Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing ActiveX control
Message
From
06/01/2005 10:53:26
 
General information
Forum:
Visual FoxPro
Category:
Third party products
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00974138
Message ID:
00974693
Views:
32
Hi Nadya,

sure you can create your own methods: open the OleControl subclass you created in design mode, go to the Class menu, and add methods and properties. VFP subclasses ActiveX controls incredibly easy: so easy it's unbelievable. <g>

With regard to this particular control, I played with it a bit about 5 years ago, and ended up making my own, using the mscal in mscomct2.ocx, which I put on a form whose deac closes the form, and which I position where I want it, etc. I have it integrated into other controls, e.g., a Quicken-style date input which is subclassed off the framework textbox, and which therefore has validation built-in, etc. I like DBI controls, but this one didn't offer me anything I wanted to use.

Hank

>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.
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform