0

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?

Neo
  • 755
  • 1
  • 10
  • 24
  • did you read thru the documentation here..? it gives you step by step examples on how to use this in both winforms and embedded web https://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application – MethodMan Dec 10 '17 at 06:25
  • where are you calling this `InitializeChromium();` – MethodMan Dec 10 '17 at 06:27
  • @MethodMan, thats the InitBrowser(); called inside the Form1(). And I have installed the CefSharp nuGet package as per instructions. – Neo Dec 10 '17 at 06:33
  • using version 71 and getting the same error Neo. Did you ever find a solution? – Garet Jax Feb 19 '19 at 17:57

0 Answers0