Below is my code extract relative to the problem
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Timers;
using System.Threading.Tasks;
using System.Web.UI.Design;
using System.Windows;
using System.Windows.Forms;
using cef;
using CefSharp;
using CefSharp.WinForms;
public partial class Form1 : Form
{
//browser variables
public ChromiumWebBrowser chrome;
public Form1()
{
InitializeComponent(); InitBrowser(); this.WindowState =System.Windows.Forms.FormWindowState.Maximized;
}
public void InitBrowser()
{
chromeheight = this.Height-100;
chromewidth = this.Width;
Cef.Initialize(new CefSettings()); chrome = new ChromiumWebBrowser("correct url here");
this.Controls.Add(chrome); chrome.Anchor = AnchorStyles.Left;
chrome.Size = new Size(chromewidth, chromeheight);
chrome.Location = new Point(0, 100);
chrome.LoadingStateChanged += chrome_LoadingStateChanged;
}
public void chrome_LoadingStateChanged(object sender,LoadingStateChangedEventArgs e)
{
//the problem!!!
chrome....
}
}
the problem is at the last line. When I type chrome.IsLoaded
, the IsLoaded
option is not available. Everything else works fine.
below is the error I get.
Error 17 'CefSharp.WinForms.ChromiumWebBrowser' does not contain a
definition for 'IsLoaded' method 'IsLoaded' accepting a first argument of
type 'CefSharp.WinForms.ChromiumWebBrowser' could be found (are you missing
a using directive or an assembly reference?)
What am I doing wrong?