1. Add two references:WindowsFormsIntegration.dll (responsible for integrating WPF and Windows), System.Windows.Forms.
2. Add two references in the XAML file (Bold section):
<Windowx:class= "Crossbowdemo.mainwindow"Xmlns:wfi= "Clr-namespace:system.windows.forms.integration;assembly=windowsformsintegration"XMLNS:WF= "Clr-namespace:system.windows.forms;assembly=system.windows.forms"xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml"Title= "Hosting Windows Forms Control in WPF"Height= "+"Width= "650"ResizeMode= "Noresize"Loaded= "Windowloadedhandler"></window>
3. Add controls in XAML:
< windowsformshost name = "WindowsFormsHost" Margin = "0" Background = "#FF323E34" > < wf:picturebox name = "Mainbox" Span style= "color: #ff0000;" > Paint = "Picturebox_paint" ></ wf:picturebox > </ windowsformshost >
"WPF" in WPF calls WinForm