i'm displaying a openlayers map inside a winform web browser, since i'm getting focused on map element(with a click on the map), i have not getting mouse wheel events any more,even not document mousewheel event, to start getting the events again i need to click on some other element rather than a map element. when the app is running outside of the web browser(in IE,chrome,Firefox) everything working fine. Has anyone seen a similar problem?

  • Yes, countless times, for countless reasons. Most likely you have a Javascript error somewhere. Without a minimum working example, it is likely to be rather hard to diagnose. Commented Mar 19, 2015 at 11:50
  • As i said, everything working fine in a browser, the problem is winform web browser. i have no errors. Commented Mar 19, 2015 at 12:12

1 Answer 1


This is because losing focus on the map inside winform. You can use yourBrowserControl.Document.Focus() to re-focus on the map after any of your c# actions and you will get your mouse wheel control back.

In my case, I used splitContainer to split the screen and I used the following code which works out great. Every time when I click on the map, it will gain the focus back to the map, then the mouse wheel will work.

// add event hander
this.splitContainerMain.Panel2.Enter += new System.EventHandler(this.splitContainerMain_Panel2_Enter);

// handler method
private void splitContainerMain_Panel2_Enter(object sender, EventArgs e){
    if (webBrowserMap.Document != null)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.