Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RTF blues, DHTML control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00703202
Message ID:
00704278
Views:
51
Vlad,
Your code works very well, there was a minor problem when double clicking a word, the behaviour was as I was holding the left key.
I solved it by adding a property to the form, lOCXHasFocus, and changing the code like this:
*-- onmousedown 
if not thisform.lOCXHasFocus
    This.Setfocus()
endif
thisform.lOCXHasFocus = .t.
and
*-- onblur 
thisform.lOCXHasFocus = .f.
this.enabled = .f.
this.enabled = .t.
Thanks a lot, I owe you a drink, as people say over here.

Max



>Hi!
>
>I looked to your form and figured out what is a problem. Do following:
>
>
>*** ActiveX Control Event - onblur***
>this.Enabled = .F.
>this.Enabled = .T.
>
>
>and following:
>
>
>*** ActiveX Control Event - onmousedown ***
>this.SetFocus()
>
>
>The first on is needed to notify VFP that control loses focus. The second one is to notify VFP that control gets focus.
>
>The real problem is that VFP, for some reason, does not track correctly focus for OLE control. I think this could be reported as a bug to MS. You can see how it works by opening Output window in debugger and switch on events tracking. When going into the OLE control and out of it, LostFocus() and GotFocus() events never fired for OLE control. In VFP6 LostFocus fired, while GotFocus is not etc. Quite strange.
>
>I do not know if my fix will cause no any extra side-effects. Just keep in mins this in case of something.
>
>
>As about additional events - open MSDN knowledge base library, and look for elements and objects of HTML document - DOM objects model. The events you see are events of the topmost object for HTML document - for window object. They're only events exposed by VFP in design time. The rest of events are deeply inside of the DOM. You can access every object and preoprty of it in HTML document through DOM property, as well as bind to events of each object in run-time. Much like in Java Script - everything you can do in Java Script with HTML document (in IE 5.0), you can do as well with objects in HTML document loaded in this ActiveX. I tried it once and see that this is very powerful and flexible thing.
>
>HTH.
>

...Y soy feliz, bien feliz, asi lo grito;
Mira, que el mundo sepa, que se sepa:
Soy feliz....                       

...And I'm happy, quite happy, so do I yell it;
Look, so the world knows it, so be known:
I'm happy...
 

Ismael Rivera "Oye cosita linda"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform