This should solve your problem. He turned off the accelerator keys of the web browser.
webBrowser1.WebBrowserShortcutsEnabled = false;
You might want to know if you need one IsWebBrowserContextMenuEnabled.
The following may also solve your problem if you need some accelerator keys that will be active in the browser. However, this approach requires something to catch the focus. MessageBox.Show()and dialog.ShowDialog()can do the job
private void DoSomething()
{
webBrowser1.PreviewKeyDown += new PreviewKeyDownEventHandler(webBrowser1_PreviewKeyDown);
}
private void webBrowser1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.Control && e.KeyCode == Keys.O)
{
menuItem.PerformClick();
}
}
source
share