I'm looking to create a very simple program that's only function is to display my website. So basically the program would be like an iframe of the website. What is the best way to achieve this?
Asked
Active
Viewed 756 times
-1
-
What's this got to do with C++ or C#? – Luchian Grigore Sep 13 '12 at 17:45
-
I figured that as I need it to be a standalone Windows program, it needs to be coded in a real language like C++/C# – Perulo Sep 13 '12 at 17:46
-
2Why don't you just let them use their own web browser? – user1477388 Sep 13 '12 at 17:49
1 Answers
2
You can't use iFrame since it is a browser technology. You must use a web browser as follows, I believe:
using System;
using System.Windows.Forms;
namespace WindowsFormsApplication10
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// When the form loads, open this web page.
webBrowser1.Navigate("http://www.dotnetperls.com/");
}
private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
// While the page has not yet loaded, set the text.
this.Text = "Navigating";
}
private void webBrowser1_DocumentCompleted(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
// Better use the e parameter to get the url.
// ... This makes the method more generic and reusable.
this.Text = e.Url.ToString() + " loaded";
}
}
}
Ref. http://www.dotnetperls.com/webbrowser
Note: Example is in C#.
Check this out for C++ What embedded browser for C++ project?

Community
- 1
- 1

user1477388
- 20,790
- 32
- 144
- 264
-
Wow, thank you very much for such a quick reply!! By the way, does it launch the website in the default browser or IE? – Perulo Sep 13 '12 at 17:52
-
-
1@Perulo control will use IE as Embed Browser within Form1 if that's what you refer – Erre Efe Sep 13 '12 at 17:54
-