Embed Internet Explorer browser into Winforms usin

2019-02-25 10:00发布

问题:

I'm trying to open a IP specified webpage using IE (Why IE? Because not every Windows have Chrome or Firefox installed) and present it in a simple Winforms window.

The up-mentioned webpage is a BI (Business Intelligence) webpage that will update itself dynamically, and I want the user to sit and look at it while the page is updated with a new statistics.

Flow of events:

  • User will enter the specific IP address and click "Get the Web-page".

  • New Winform window will pop-up with the specific webpage inside.

Also, it will be great if there an option to hide IE navigation panel, because I don't want to give the option of browsing in this window.

I tried to do this using CefSharp, but I didn't get to anywhere. Every example that I saw was written in asp.

Here is was I did so far, and this is not working:

namespace BingoDesktopWindow
{
    public partial class BingoWin : Form
    {
        public BingoWin()
        {
            InitializeComponent();

            CefSettings settings = new CefSettings();
            CefSharp.Cef.Initialize(settings);

            ChromiumWebBrowser browser = new ChromiumWebBrowser("http://12.345.67.89/bingo/Default.html");
            this.browserPanel.Container.Add(browser);
        }
    }

Thank you! }

回答1:

Why do not you use Winforms WebBrowser control. WinForms WebBrowserControl. You can manipulate it more than IE. Web browser control is itself derived from IE so, it has all its functionalities.