When the user focuses on managing the web browser and press a key Space, the web browser will scroll down. How to disable this event?
Finally, this javascript code solves my problem:
onkeypress='if(event.keyCode=13) return false;'
because a false return for spaceKey prevents the web browser from scrolling!
I think you need to interrupt the keyboard event from your application and cancel the event information sent to your control, make sure that you do not cancel the SpaceKey all the time, as would be necessary in other places.
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress.aspx
, !
use the event _PreviewKeyDownexample:
If e.KeyCode = Keys.Space Then WebBrowser1.Navigate("javascript:scroll(0,0)") End If
;)