嗨,我在我的项目中使用cefsharp,在创建类并通过线程开始工作后,给我这个错误,请帮助我修复。 我的班级:
public void InitializeChromium()
{
CefSettings settings = new CefSettings();
// Initialize cef with the provided settings
Cef.Initialize(settings);
// Create a browser component
chromeBrowser = new ChromiumWebBrowser("http://ourcodeworld.com");
// Add it to the form and fill it to the form window.
web_tab = new TabPage();
web_tab.Controls.Add(chromeBrowser);
web_tab.Text = "Thread";
tab_con.TabPages.Add(web_tab);
//Invoke(new Action(() => ));
//chromeBrowser.Dock = DockStyle.Fill;
}
我的项目:
private void button1_Click(object sender, EventArgs e)
{
Browser_Class f1 = new Browser_Class();
f1.tab_con = tabControl1;
Thread mythread = new Thread(f1.InitializeChromium);
mythread.Start();
}