Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CefSharp.WinForms "Dock =DockStyle.Fill" no effect, black edge.how to make the ChromiumWebBrowser fill the TBForm?

public partial class TBForm : Form
{
    private readonly ChromiumWebBrowser browser;

    public TBForm()
    {
        InitializeComponent();

        browser = new ChromiumWebBrowser("www.baidu.com")
        {
            Dock = DockStyle.Fill,
        };

        this.Controls.Add(browser);
    }
}

i got this result

CefSharp.WinForms "Dock =DockStyle.Fill" no effect, black edge.

how to make the ChromiumWebBrowser fill the TBForm?

like image 271
王一奇 Avatar asked Oct 21 '25 14:10

王一奇


1 Answers

Do you tried disable the GPU engine using CefCommandLineArgs?

When you declare:

CefSettings settings = new CefSettings();

before initializations:

Cef.Initialize(settings);

Try to add the nex line of code:

settings.CefCommandLineArgs.Add("disable-gpu", "1");
like image 112
max avdieiev Avatar answered Oct 24 '25 05:10

max avdieiev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!