Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to disable rightclick of Web Browser Control
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00595476
Message ID:
00596927
Views:
37
>>>>>>Look at appendChild, insertAdjacentElement, insertAdjacentHTML, innerHTML methods on MSDN for ways to insert the script into the loaded HTML page. If all else fails you can always write the original file as a local file, modify it there and reload it with the changes.
>>>
>>>Ok. No problem with insert strings into my loaded HTML... the big problem is that I didn´t find a JavaScript that does the job correctly... every script I found just shows an alert window, and if I rip off the allert, the code doesn´t work...
>>
>>I got it!
>>But not full proof. Double rigthclick launch the context menu.
>>
>>
>>	[<S*RIPT LANGUAGE="JScript">]+chr(10)+;
>>	[function noway() { ]+chr(10)+;
>>	[if (event.button == 2) { ]+chr(10)+;
>>	[document.body.dragDrop();]+chr(10)+;
>>	[return false; ]+chr(10)+;
>>	[} ]+chr(10)+;
>>	[} ]+chr(10)+;
>>	[document.body.onmousedown=noway;]+CHR(10)+;
>>	[</S*RIPT>]
>>
>>
>>
>>HTH
>
>Now i got it, i add a timeout to 1/10 second and repeat the same operation to disable an eventual second click.
>
>Here is the code to add after the body tag in your page:
>
>
>	[<S*RIPT LANGUAGE="JScript">]+chr(10)+;
>	[function noway() { ]+chr(10)+;
>	[if (event.button == 2) { ]+chr(10)+;
>	[document.body.dragDrop();]+chr(10)+;
>	[window.setTimeout("noClick()",100)]+chr(10)+;
>	[return false; ]+chr(10)+;
>	[} ]+chr(10)+;
>	[} ]+chr(10)+;
>	[function noClick() { ]+chr(10)+;
>	[document.body.dragDrop();]+chr(10)+;
>	[} ]+chr(10)+;
>	[document.body.onmousedown=noway;]+CHR(10)+;
>	[</S*RIPT>]
>
>
In the Body tag you could just enter
< BODY oncontextmenu="return false">
Wouldn't that turn off the RightMouse, but maybe for only I.E.

You would have to put that inside the Body tag of the HTML being shown.
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform