-1

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?

dove
  • 20,469
  • 14
  • 82
  • 108
Perulo
  • 69
  • 2
  • 7

1 Answers1

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