private void MainForm_Load(object sender, EventArgs e) { SNLabel.Left = this.Size.Width - SNLabel.Size.Width; SNLabel.Top = this.Size.Height - SNLabel.Size.Height; SNLabel.BackColor = System.Drawing.Color.Transparent; this.SNLabel.Visible = !MachineInfo.CheckSN(Config.SN); string url = System.IO.Path.Combine(Config.H5Path, "index.html"); _webCom = new CefSharp.WinForms.ChromiumWebBrowser(url); _webCom.Dock = DockStyle.Fill; var cbBrower = new CBrowser(); _webCom.RegisterJsObject("CAjax", new CAjax()); _webCom.RegisterJsObject("CBrowser", cbBrower); _webCom.FrameLoadEnd += WebCom_FrameLoadEnd; _webCom.MenuHandler = new MenuHandler(); this.Controls.Add(_webCom); cbBrower.playAdsAction = SafePlayAds; _webCom.SendToBack(); }
private void AdsForm_Load(object sender, EventArgs e) { string url = System.IO.Path.Combine(Config.H5Path, "ads.html"); _webCom = new CefSharp.WinForms.ChromiumWebBrowser(url); _webCom.Dock = DockStyle.Fill; var cbBrower = new CBrowser(); _webCom.RegisterJsObject("CAjax", new CAjax()); _webCom.RegisterJsObject("CBrowser", cbBrower); _webCom.FrameLoadEnd += WebCom_FrameLoadEnd; _webCom.MenuHandler = new MenuHandler(); this.Controls.Add(_webCom); cbBrower.closeAction = CloseWindowSafe; }