Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web browser control and context menu
Message
From
28/05/2007 21:29:14
Mike Sue-Ping
Cambridge, Ontario, Canada
 
 
To
28/05/2007 17:52:31
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01228919
Message ID:
01228949
Views:
23
>>Does anyone know if it is possible to implement a custom VFP context/shortcut menu on the web browser control hosted in a VFP form?
>
>Any DHTML element to which you want to attach your own contextmenu needs to have a redirection into your JavaScript code, like this
>
>
onContextMenu="rclick(event);"
>
>where rclick(e) is your piece of JavaScript:
>
>
function rclick(e)
>{
>	var targ
>	if (!e)
>		var e = window.event;
>	if (e.target)
>		targ = e.target
>	else if (e.srcElement)
>		targ = e.srcElement;
>	e.returnValue=false;
>	oFrm=document.forms[0];
>	oFrm.action="YourProtocolHere:"+targ.name;
>	oFrm.submit();
>	return false;
>}
>
>Then you catch your protocol in oBrowser.BeforeNavigate2, make sure cancel=.t. so it doesn't try to navigate anywhere. You may also add code to catch some coordinates (browser's event object has a few properties which may help, but you'll need to recalculate the position) so to know where to show your VFP popup.

Thanks Dragan. Your code gives me a starting point.

Regards,
Mike
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform