Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox valid with Active X control
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00299058
Message ID:
00299228
Vues:
24
>>>>>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.

Well, you might try updating the 'last' control property in the GotFocus of the textbox (obviously, it had to get focus at some point) and then check it when your ActiveX control receives focus.

As to why you can put a VFP control on top if an ActiveX control, there's no provision for containership by an ActiveX control. VFP native controls are not 'standard' Windows controls, in that they do not each have their own hWND reference, and the ActiveX control doesn't know how to manipulate them directly.

You might also try setting the AutoYield property of the Application object to .F. to see if things behave a bit better by keeping ActiveX control events from firing between lines of VFP code. The ActiveX control will be given an opportunity to fire during any VFP wait state.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform