chongshao123
肆水静若明镜
采纳率0%
2020-01-08 16:50 阅读 687

WinForm使用CefSharp内嵌网页分页为啥显示成这样?

内嵌显示效果

正常Chrom浏览器访问效果:

 public void InitBrowser()
        {
            var setting = new CefSettings
            {
                Locale = "zh-CN",
                //CachePath = "CHBrowser/BrowserCache",
                AcceptLanguageList = "zh-CN,zh;q=0.8",
                LocalesDirPath = "CHBrowser/localeDir",
                LogFile = "CHBrowser/LogData",
                PersistSessionCookies = true,
                UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36",
                UserDataPath = "CHBrowser/userData"
            };
            setting.CefCommandLineArgs.Add("disable-gpu", "1");
            CefSharpSettings.LegacyJavascriptBindingEnabled = true;
            ///初始化
            Cef.Initialize(setting);
            WebBrowser = new ChromiumWebBrowser("xxxxxx");
            WebBrowser.RegisterJsObject("PortSIP", portSIP, new BindingOptions() { CamelCaseJavascriptNames = false });
            WebBrowser.Dock = DockStyle.Fill;
            WebBrowser.Dock = DockStyle.Fill;
            this.Controls.Add(WebBrowser);
            WebBrowser.MenuHandler = new MenuHandler();
            setting.CefCommandLineArgs.Add("no-proxy-server", "1");
            WebBrowser.FrameLoadEnd += Web_FrameLoadEnd;
            WebBrowser.DragHandler = new DragHandler();
        }

没有币呢 如能解决 现金红包感谢

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

相关推荐