Category / Section
How to restrict the overlapping behavior of windows forms controls inside WPF DockingManager?
1 min read
While interacting the WindowsForm control with WPF DockingManager control, it leads to inaccessibility of WPF controls behind WindowsForm control, since the WindowsForm control is on top. We can restrict this behavior by setting UseInteropCompatibilityMode property as true to access the WPF controls on top.
MainWindow.Xaml
<syncfusion:DockingManager UseInteropCompatibilityMode="True" UseDocumentContainer="True" x:Name="Docking"> <ContentControl syncfusion:DockingManager.Header="Dock"/> </syncfusion:DockingManager>
C#
public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); WindowsFormsHost host = new WindowsFormsHost(); System.Windows.Forms.TextBox text = new System.Windows.Forms.TextBox(); host.Child = text; DockingManager.SetState(host, DockState.Document); DockingManager.SetHeader(host, "Dock2"); Docking.Children.Add(host); } }