Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable F5 in WebBrowser [duplicate]

Tags:

browser

c#

.net

Possible Duplicates:
Disable browser's back button
How do I disable the F5 refresh on the browser?

Hi,

I created an application in C# that will download data from the internet (and this is done one time only) and put it in a webbrowser and this data should be static. I want to know if there is a way to disable the F5 key from doing a refresh?

I tried injecting javascript to disable F5 but it will still refresh the webbrowser.

like image 617
jantox Avatar asked Oct 25 '10 02:10

jantox


People also ask

How do I turn off f5 refresh in Chrome?

You can only do it by disabling F5. I googled "Disable F5 Refresh" and got quite enough searches to figure it out quickly. If you disable my F5 , I'll try CTRL+W or ALT+F4 next.

How do I disable f5 on my keyboard?

off("keydown", disableF5); On a side note: This only disables the f5 button on the keyboard.

How do I stop browser from refreshing?

Click the Start button, type “internet options” and select Internet Options in the search results. In the Internet Properties window, click “Custom tab -> Custom level,” then in the Security Settings window, scroll down until you find “Allow META REFRESH.” Disable this option and click OK.

How do I stop f5 refresh in a form?

we can easily disable f5 button using javascript with example. we will disable f5 key using keydown event of jquery. as we know f5 key code is a 116, so basically if user will press 116 event. keyCode then we will simply preventDefault with return false.


1 Answers

You cannot disable F5 (or other browser shortcut keys) via JavaScript.

Setting the WebBrowserShortcutsEnabled property of the WebBrowser control to false should accomplish what you're trying to do.

like image 65
josh3736 Avatar answered Oct 17 '22 16:10

josh3736