Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keypress and Keypreview problem
Message
From
06/12/2008 14:44:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
05/12/2008 10:51:09
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:
01365783
Views:
14
>>>I've got a web browser control on a VFP form whose keypreview is set to .T. I've put code in the form's keypress and I've discovered that the code does not execute because of the web browser control. I've tested this scenario with another activeX control and the same thing happens. If I remove the activeX control, the form's keypress code fires.
>>>
>>>Has anyone encountered this and know of a workaround?
>>>
>>>What I'm trying to do is implement some keyboard shortcuts like F5 to refresh the content displayed in the web browser.
>>>
>>>TIA,
>>>Mike
>>
>>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform