I am using the webBrowser.Navigate(url) control to display the page.
I noticed that this action steals focus from the current control (grid), and I have a problem to focus the grid back (tired myGrid.Focus, .Select, etc.)
This is really annoying browser behavior ...
Does anyone know how to prevent the browser from stealing focus or (if not) to get the focus to control back?
EDIT:
I also tried the webBrowser.DocumentCompleted event to focus on the grid
EDIT 2
A good case for checking this is to open the PDF files webBrowser.Navigate(@"C:\TEMP\test.pdf") I think this is an ActiveX problem. At first glance, it seems that this is not a problem with focus control, but the loss of all the focus of the form ...
EDIT 3
I tried a different approach: the key key: Form event I think I can capture the keyPress form and transfer the focus from WebBrowser / AdobeReader ActiveX to my control. But surprisingly the event is not fired! Looks Reader gets all the control, and there is no way to do anything programmatically until you click on (at least) the form caption
Any recommendations (s)?
source share