WinForms in CEF 3.1650.1562

166 views
Skip to first unread message

Michele Brigadoi

unread,
Apr 23, 2014, 12:23:50 PM4/23/14
to cefs...@googlegroups.com
Hi,

I've correctly added the CefSharp and CefSharp.WinForms references, so I wrote this code:

using System;
using System.Windows.Forms;
using CefSharp.WinForms;
using CefSharp;

namespace Test
{
    public partial class TestForm : Form
    {
        public WebView webView;

        public TestForm()
        {
            InitializeComponent();
            
            webView = new WebView("www.google.com")
            {
                Dock = DockStyle.Fill
            };
            
            this.Controls.Add(webView);
        }
    }
}

and, when I execute it, I don't get any error, but the Form is empty,
I added a Breakpoint, so I verified that the code runs.

Can you please help me to solve this?
Thanks in Advance,
Michele.

Jørn Hansen

unread,
Apr 25, 2014, 3:48:31 PM4/25/14
to cefs...@googlegroups.com
It looks like you are missing a call to Cef.Initialize() e.g. like the one in https://github.com/cefsharp/CefSharp/blob/v31.0.0-pre1/CefSharp.Example/ExamplePresenter.cs#L31

The ExamplePresenter.cs and other code in the CefSharp.Example project contain some common code used across both the WPF and WinForms example apps.

--
Best regards,
JornH
Message has been deleted
Message has been deleted

Michele Brigadoi

unread,
Apr 26, 2014, 5:46:34 AM4/26/14
to cefs...@googlegroups.com
Thanks,

It Works!

Youli Yang

unread,
Sep 7, 2014, 12:28:26 AM9/7/14
to cefs...@googlegroups.com
Hi,

I have the same question . Can you please help me to solve this?

and I saw the JornH's answer. sorry I can't get it.

Thanks.

YangYL 
Reply all
Reply to author
Forward
0 new messages