We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Docking Manager and WindowsFormsIntegration

Hi
how to make:

Creating a form from a WinForms Control hosted within WPF (Docking Manager)

 UserControl1 rtb = new UserControl1();
            System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost();
            host.Child = rtb;
            grid.Children.Add(host);


1. AddElementWF_Click    ADD - Window2.XAML
2. AddElementWUC_Click  ADD - UserControl1.cs
3. AddElementWPF_Click ADD Form2.cs

Attachment: CS2_18575e0a.zip

1 Reply

VR Vijayalakshmi Roopkumar Syncfusion Team May 6, 2016 06:56 AM UTC

Hi Grzegorz,

Thank you for using Syncfusion products.

We have checked your sample and found that you have tried to add the WPF window, Usercontrol and WindowsFormsHost element in the DocumentContainer. In our DocumentContainer, you can add only the element which are derived from the Dependency object. But in your sample, you have tried to add the System.Windows.Forms.Usercontrol which is not derived from the DependencyObject, so it will not be added as a child of DocumentContainer. To add this as a child of DocumentContainer, you can host the Usercontrol inside WindowsFormsHost. You cannot add WPF window as a child of DocumentContainer, since window cannot be a child of any visual element.

Regards,
Vijayalakshmi V.R.
 


Loader.
Live Chat Icon For mobile
Up arrow icon