Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress and Keypreview problem
Message
 
 
To
07/12/2008 16:55:36
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01365671
Message ID:
01365872
Views:
13
>>>>I found this message Re: Function Key and Calendar Control Thread #842812 Message #842914 seems to be related.
>>>
>>>Thanks Naomi. Unfortunately the browser control does not have any key events that I can see to trap!
>>
>>But the document in it does. You may add
>>
>>onContextMenu="rclick(event);" onChange="changed(this);"
>>
>>or something of the kind to any element in the DOM of the document, and then have the Javascript functions pass the info to the browser control as a suitable URL that you can catch in oBrowser.Navigate() (because it's literally a control that you control :). You set cancel=.f. so it doesn't actually go anywhere, it's just your callback function.
>>
>>If the javascript functions and on* properties of the elements in the page aren't there, you can insert them invisibly when the page loads. It's under your control via DOM, you can set properties, insert text (visible or not), insert elements, hide and show... you run the show, you can add the script and make it be called, all in the two microjiffies between page load and actually letting the user see it.
>
>Hi Dragan,
>
>Thanks for the reply. I'm am aware of the items that you've described above. In fact, I'm doing exactly what you're saying, i.e., using javascript (onclick, onmouseover, onmouseout, etc.) in addition to using the Navigate method as a callback to VFP to do the heavy lifting (retrieving the data from a VFP database and generating HTML). The thing is, I'm not very good at javascript and would have preferred to find a native VFP solution to detect when a key is pressed and act accordingly.
>
>I was almost there with the form's keypreview and keypress event until the browser control got in the way :)
>
>BTW, do you have any suggestion as to what javascript event I should investigate for a keypress?
>
>Mike

Look for OnKeyDown event.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform