Preferably using JavaScript but would like to hear other ways too
This will disable F5, but not the actual refresh function:
document.onkeydown = function (e) {
if (e.keyCode === 116) {
return false;
}
};
On Chrome/XP, at least.
Actually, you can.. This little routine fixed it all for me..
I needed the other shortcuts, but not F5.
Private Sub WebBrowser1_PreviewKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PreviewKeyDownEventArgs) Handles WebBrowser1.PreviewKeyDown
If e.KeyCode = Keys.F5 Then WebBrowser1.WebBrowserShortcutsEnabled = False Else WebBrowser1.WebBrowserShortcutsEnabled = True
End Sub
Quick and dirty, but it works. Now, I can still use the Ctrl-B, I and U for editing, but I don't have to worry about refresh killing it!!
Enjoy!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With