Open a Web Browser
-
Can someone show me how i can open Internet Explorer by clicking on a button? I'm having a hard time finding out how to do this... Thank you for taking time with this lame-o question. :)
Hi .gonad, This works
System.Diagnostics.Process.Start("http://www.codeproject.com/");
BUT if a browser is open it uses that instead, which is quite anoying for the user I spose. :( -
Hi .gonad, This works
System.Diagnostics.Process.Start("http://www.codeproject.com/");
BUT if a browser is open it uses that instead, which is quite anoying for the user I spose. :( -
Thank you for your response! :) This will work perfectly for my situation. Have a blessed day!
np, have a good day yourself :D
-
Can someone show me how i can open Internet Explorer by clicking on a button? I'm having a hard time finding out how to do this... Thank you for taking time with this lame-o question. :)
This piece of code runs well for a new browser. Dont forget to give a reference to ExplorerLib.dll ExplorerLib.InternetExplorer explorer; ExplorerLib.IWebBrowserApp webBrowser; explorer = new ExplorerLib.InternetExplorer(); webBrowser = (ExplorerLib.IWebBrowserApp) explorer; webBrowser.Visible = true; webBrowser.Url or something like that = "yourURL";
-
This piece of code runs well for a new browser. Dont forget to give a reference to ExplorerLib.dll ExplorerLib.InternetExplorer explorer; ExplorerLib.IWebBrowserApp webBrowser; explorer = new ExplorerLib.InternetExplorer(); webBrowser = (ExplorerLib.IWebBrowserApp) explorer; webBrowser.Visible = true; webBrowser.Url or something like that = "yourURL";
where to give the url there is nothing webBrowser.Url or something like that
-
where to give the url there is nothing webBrowser.Url or something like that
You could also do the following: Add reference to "Microsoft Internet Controls" (that is SHDocVw.dll) in the COM tab. Use this code:
string URL = "http://www.codeproject.com"; SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorerClass(); object empty = null; ie.Navigate(URL, ref empty, ref empty, ref empty, ref empty); ie.Visible = true;
This should solve your problem.