Introduction
Here, we will be working with adding Windows Form Application, where we can add name, employee ID and the company details in Windows Presentation Foundation (WPF).
What is Winform?
Windows Form is a segment of Microsoft .NET framework. It is a GUI (Graphical User Interface) class library, which allows us to write rich looking client Applications for tablets, laptops and desktops.
Development Requirements
Follow the following steps to add Winforms in WPF
Step 1: Run Visual Studio 2015 -> Visual C# -> Windows -> WPF Application, as shown below:

Step 2: Add the following namespacing too,
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Copy the code, given below, into MainWindow.xaml,
- <WindowsFormsHost HorizontalAlignment="Left" Height="321" VerticalAlignment="Top" Width="519" Margin="0,0,-0.333,-0.333" Background="#FF987676" />
- <Label Content="Name" HorizontalAlignment="Left" Margin="72,44,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.009,0.397" />
- <Label Content="Employee ID" HorizontalAlignment="Left" Margin="72,92,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.009,0.397" />
- <Label Content="Company" HorizontalAlignment="Left" Margin="72,147,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.009,0.397" />
- <TextBox HorizontalAlignment="Left" Height="23" Margin="252,44,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="227" />
- <TextBox HorizontalAlignment="Left" Height="23" Margin="252,96,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="227" />
- <TextBox HorizontalAlignment="Left" Height="23" Margin="252,151,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="227" />
- <Button Name="close" Content="Close" HorizontalAlignment="Left" Margin="404,206,0,0" VerticalAlignment="Top" Width="75" Click="close_Click" />








Munish APosted Jul 5, 2018, 9:24 PM
Nice article......
Raja TPosted Jul 15, 2016, 10:16 AM
Nice,Thanks for sharing
SubashPosted Jul 14, 2016, 1:29 PM
Nice
kalu singh raoPosted Jul 14, 2016, 1:32 AM
Nice...
Abhijeet SinghPosted Jul 14, 2016, 1:07 AM
Nice share...