Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Web browser control and context menu
Message
De
28/05/2007 23:17:27
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
28/05/2007 21:29:14
Mike Sue-Ping
Cambridge, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01228919
Message ID:
01228965
Vues:
20
>>>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.

Sorry that I couldn't do the rest, but that'd be proprietary code. I figure you'd figure it out.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform