I am creating console app, involving lots of services. I want to display a webpage within my program window. I know how to launch a new window ( http://dotnetpulse.blogspot.com/2006/04/opening-url-from-within-c-program.html )but I was wondering can I ask a browser to render a webpage withing my program window (in C#) ?
+1
A:
Use the WebBrowser control and pass it the URL of the web page to render.
In your Windows form, something like (off the top of my head so may need tweaking to get it to compile):
WebBrowser browser = new WebBrowser();
browser.Dock = DockStyle.Fill;
this.Add(browser);
browser.Navigate("http://www.myurl.com");
Andy Shellam
2010-04-16 07:55:56
+2
A:
The best solution would likely be to use the WebBrowser control.
This can be placed on a form and allows the web page to appear inside your application.
Here is a nice example of how to go about implementing it http://ryanfarley.com/blog/archive/2004/12/23/1330.aspx
Hope this helps
davbryn
2010-04-16 07:59:39
As your question mentioned "default browser", it's worth pointing out that the WebBrowser control wraps IE, and not the users chosen browser.
Rob
2010-04-16 08:25:57
+1
A:
In a Form you can use WebBrowser Control... in a Console Application there is no way wihout opening a new form.... but you could:
- design a form with a Webbrowser Control
- hide its border and showintask = false
- Open it at a position in your Console-Window
Steav
2010-04-16 08:15:54