Ok very simple I thought, but I can't get it to work. I have a form with a webbrowser control, that I want to capture the F5 keyPress and block it. But for the life of me I cannot do it, the WebBrowser control always gets the event.
I tried this code, but it does not work. Any help is appreciated.
private void frmMain_KeyDown(object sender, KeyEventArgs e)
{
// Capture F5 KeyPress
if (e.KeyCode == Keys.F5)
{
MessageBox.Show("F5 Key Pressed!");
e.Handled = true;
}
}
JurePosted Nov 4, 2010, 3:49 PM
webBrowser.WebBrowserShortcutsEnabled = false
But it disables all shortcuts, so you'll have to manually code the ones you want to keep.
Donald NeislerPosted Nov 4, 2010, 4:48 PM
Donald NeislerPosted Nov 4, 2010, 3:29 PM
JurePosted Nov 4, 2010, 3:11 PM
Or maybe webbrowser control even has public key events...