I’m having some problems with the control of IE through C#.
I have almost everything managed.
But I can’t seem to set the focus to opened explorer.
When I’m in VS 2010 it works, but this isn’t the case when I run the exe file directly.
using SHDocVw;
.
<code>
.
InternetExplorer ie = new InternetExplorer();
IWebBrowserApp wb = (IWebBrowserApp)ie;
.
<code>
.
wb.Visible = true;
wb.Document.focus();
I mean that wb.Document.focus(); would give focus to IE, but that dosen’t work.
Have also tried with eb.Document.focus();
Anyone have a sugestion?
Cast the ie.Document as mshtml.HTMLDocument then set the focus.