Esempio n. 1
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            if (!DesignMode)
            {
                var windowInfo = CefWindowInfo.Create();
                windowInfo.SetAsChild(Handle, new CefRectangle {
                    X = 0, Y = 0, Width = Width, Height = Height
                });

                _core.Create(windowInfo);
            }
        }
Esempio n. 2
0
        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);
        }