It seems like it’s impossible to disable printing in a webBrowser control.
Here’s what I’ve tried:
-
Setting WebBrowserShortcutsEnabled to FALSE
- This still shows a print dialog when pressing ctrl+p. The behavior seems strange, but from my testing, you can trigger the dialog while the webbrowser control still has focus. If you click on another control so the webbrowser loses focus, and click on the webbrowser again, you are unable to trigger the print dialog.
-
Overriding Ctrl+P in the Form’s KeyDown event
- This doesn’t seem to do anything at all.
-
Using Webbrowser’s PreviewKeyDown
- This doesn’t seem to be intended to intercept keys, merely preview them as you can’t cancel out keypresses with it.
It would be optimal if ALL keyboard shortcuts are disabled.
There must be some way to achieve this? Thanks.
working example..
http://jsfiddle.net/rhPxU/