public CefWebBrowser() { SetStyle( ControlStyles.ContainerControl | ControlStyles.ResizeRedraw | ControlStyles.FixedWidth | ControlStyles.FixedHeight | ControlStyles.StandardClick | ControlStyles.UserMouse | ControlStyles.SupportsTransparentBackColor | ControlStyles.StandardDoubleClick | ControlStyles.OptimizedDoubleBuffer | ControlStyles.CacheText | ControlStyles.EnableNotifyMessage | ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UseTextForAccessibility | ControlStyles.Opaque, false); SetStyle( ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Selectable, true); var settings = new CefBrowserSettings(); // settings.ImageLoading = CefState.Disabled; // settings.AcceleratedCompositing = CefState.Disabled; _core = new WebBrowser(this, settings, "about:blank"); _core.Created += new EventHandler(BrowserCreated); }
protected override void Dispose(bool disposing) { if (_core != null && disposing) { _core.Close(); } _core = null; _browserWindowHandle = IntPtr.Zero; base.Dispose(disposing); }
public CefWebView(string url, bool transparent = false) { _core = new WebBrowser(this, new CefBrowserSettings(), url ?? "about:blank"); _core.Created += new EventHandler(BrowserCreated); var windowInfo = CefWindowInfo.Create(); windowInfo.SetAsPopup(IntPtr.Zero, null); windowInfo.Name = url; if (transparent) { windowInfo.SetTransparentPainting(true); windowInfo.Width = 500; windowInfo.Height = 500; //windowInfo.Style = WindowStyle.WS_POPUP | WindowStyle.WS_SIZEFRAME | WindowStyle.WS_VISIBLE; windowInfo.StyleEx = WindowStyleEx.WS_EX_COMPOSITED; } _core.Create(windowInfo); }
public CefWebView(string url, bool transparent = false) { _core = new WebBrowser(this, new CefBrowserSettings(), url ?? "about:blank"); _core.Created += new EventHandler <CefBrowserCreatedEventArgs>(BrowserCreated); var windowInfo = CefWindowInfo.Create(); windowInfo.SetAsPopup(IntPtr.Zero, null); windowInfo.Name = url; if (transparent) { windowInfo.Width = 500; windowInfo.Height = 500; //windowInfo.Style = WindowStyle.WS_POPUP | WindowStyle.WS_SIZEFRAME | WindowStyle.WS_VISIBLE; windowInfo.StyleEx = WindowStyleEx.WS_EX_COMPOSITED; } _core.Create(windowInfo); }
public void Attach(WebBrowser browser) { _browser = browser; }