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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Platform : WPF
|
Category : Win32 in WPF

How do I host a Windows Forms control in a WPF application ?

First make sure to add references to "System.Windows.Forms" and "System.Windows.Forms.Integration". Then you need to decide if you will use code, XAML or a combination of both to work with the Windows Forms controls. If you are strictly using code, you would write code similar to the following :

If you are using XAML, you still need to add the references to "System.Windows.Forms" and "System.Windows.Forms.Integration", but you will also need to add mapping statements to your XAML that will allow you to refer to the objects that live in these namespaces via XAML:

The "XMLNamespace" property provides a way to create a tag that you can use as a namespace prefix in the XAML to refer to the controls within the "System.Windows.Forms" and "System.Windows.Forms.Integration" namespaces. To enable this, you must also create "xmlns" properties in the XAML that maps back to these prefixes as given below :

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon