About KeyEvent Solution!
Hi! Man
I find a solution for the ChromiumWebBrowser KeyEvent with WinForm.
I read the blog http://www.codeproject.com/Articles/990346/Using-HTML-as-UI-Elements-in-a-WinForms-Applicatio, and you refer
[As a side-note, I initially attempted to catch the F12 key on the form, however even with KeyPreview set to true, it seemed Chrome caught all key strokes and the key preview was never caught by the WinForm class.]
- bind the PreviewKeyDown event and set the KeyboardHandler to a Class which implement IKeyboardHandler
- in IKeyboardHandler.OnPreKeyEvent(IWebBrowser browserControl,...) method, I call the Control.PreProcessControlMessage(ref Message msg) for send message to the PreviewKeyDown event
- Just OK.
Mail to me, friend.
Hi Jerviscui.
Thanks for your note and this info. That's great. When I am next in this project area I will update the code with your solution.
Excuse me! Can you tell me how to trigger KeyPressEvent by CefSharp, I want IKeyboardHandler execute that, but doesn't work. Do you have any good idea? Thx.