I have a very complex winforms app that occasionally loads a DotNetBrowser component instance to render dynamic web content in one section of the UI. The primary navigation mechanism is a tree control and when a node of that tree is selected and that node has associated HTML content, then the DNB component is initialized and the content loaded. When this happens the tree loses the input focus. I have other components that are loaded dynamically into the same place in the same way, and those components do not steal the input focus. So this appears to be particular to the DotNetBrowser component.
I've tried setting Focused = false on the underlying browser view component on the FinishedLoadingFrame event but I suspect that at that point it's too late.
I do need the DNB component to receive the input focus at some point, when the user clicks on it, but I can't have it grabbing focus as it's instantiated or after it's loaded content. Is there a way to accomplish this?
By default, BrowserView obtains the focus after it is shown on a layout. You can disable this behavior with the BrowserView.InitialFocusOwner property.