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.
TypeScript
private void frmMain_KeyDown(object sender, KeyEventArgs e)
{
// Capture F5 KeyPress
if (e.KeyCode == Keys.F5)
{
MessageBox.Show("F5 Key Pressed!");
e.Handled = true;
}
}
JureRank #2,128 · 670 reputationPosted Nov 4, 2010, 11:49 AM EDT
webBrowser.WebBrowserShortcutsEnabled = false
But it disables all shortcuts, so you'll have to manually code the ones you want to keep.
JureRank #2,128 · 670 reputationPosted Nov 4, 2010, 11:11 AM EDT
Or maybe webbrowser control even has public key events...
Donald Neisler6 reputationPosted Nov 4, 2010, 11:29 AM EDT
Donald Neisler6 reputationPosted Nov 4, 2010, 12:48 PM EDT