I was using the .Net WebBrowser object but don't like the messy way the compatibility mode works. So I switched to CEFSharp object.
However, the object doesn't display in my form. I looked at the Example Winform project with CEFSharp but it doesn't seem to display it in a winform but runs it as a separate application which isn't want i want.
I figure I am missing some obvious method or property that must be set initially. In the code below I have what I am using for CEFSharp and you will see two lines commented out which is what I was using for .Net WebBrowser that worked.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp.WinForms;
namespace GoogleSiren
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ChromiumWebBrowser myBrowser = new ChromiumWebBrowser("http://wwww.cnn.com");
//WebBrowser myBrowser = new WebBrowser();
//myBrowser.Navigate("http://www.cnn.com");
myBrowser.Location = new Point(200, 200);
myBrowser.Size = new Size(500, 300);
this.Controls.Add(myBrowser);
}
}
}