Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox valid with Active X control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00299058
Message ID:
00299221
Views:
22
>>>>I have a textbox and I need to have the valid/lost focus methods run. I also have a DBI Active X control on my form used to change pages in my pageframe. My problem is that the valid/lost focus methods of my textboxes are not fired when I click on the Active X control. How can I force the valid/lost focus methods to fire. I tried putting an invisible commandbutton on top of the Active X control to manually make the calls to the Active X control but no controls can go on top of the Active X control even when I use "Bring to Front" Any ideas?
>>>
>>>Is there a click event for the control that you can use to fire the lostfocus of the active control?
>>
>>It does have that kind of method but how would I know what control (textbox) I just came from? There are about 150 controls on my form that all need to make sure their valids are executed if the user alters the control. The Active X object is used to change pages on the form. I like the look of it. This problem seems like it could be a big deal for ALL Active X controls if this is what happens. There must be a way to make sure the valid/lost focus is executed?
>
>Add a form property to hold the last referenced property identity. Clear this value in the Activate event of the form. In the LostFocus event of each textbox, update the form property to hold the control reference (best done by a subclass of the control). Anything that needs to know what the lasat referenced control was can check the form property.
>
>An alternative that may work is to check the Form.ActiveControl value in the When event; if valid, Form.ActiveControl should still point at the previous control. You need to check that TYPE('thisform.ActiveControl') = 'O' to see if it is valid; and Edward Pikman pointed out that depending on how you transition to the control (tab/mouseclick) Form.ActiveCOntrol is fairly likely to be invalid.

This LostFocus of the textbox doesn't fire either. It seems like the Active X control stops all usual firing of events. Where would I put the code for the first suggestion? The second sounds like it wont work.
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform