In my project I have integrated MDI and CEF. I am basically trying to open Cef browser in MDI child windows.
I have currently hosted my CefWebbrowser in WindowsFormHost Controller.
The problem I am facing is the Cef browser isnt fitting to the window. It shows inside my child window which has the WindowsFormHost Controller. But if i bring another window, the web pages overlap.
In a nutshell, my problem is that the Cef browser is opening inside my window(showing scroll bars etc also). But its not fitted into the window, bringing any other window on it starts overlapping the content.
I am not sure if its a problem from CEF settings side or from WindowsFormHost.
This is my piece of code.
CefWebBrowserControl.xaml
- Code: Select all
<UserControl x:Class="UI.View.CefWebBrowserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<WindowsFormsHost Name="BrowserHost"></WindowsFormsHost>
</Grid>
</UserControl>
CefWebBrowserControl.xaml.cs
- Code: Select all
InitializeComponent();
var browserCtl = new CefWebBrowser();
browserCtl.StartUrl = "http:\\www.google.com";
browserCtl.Dock = System.Windows.Forms.DockStyle.Fill;
browserCtl.BringToFront();
BrowserHost.Child = browserCtl;
kindly help