tags:

views:

44

answers:

1

Hi All,

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application.

Could you explain me how this is done.

Kind Regards

John

A: 

Hi John,

You need to use an ElementHost.

ElementHost es = new ElementHost();
es.HostContainer.Children.Add(screen); // where screen is your wpf window or user control

es.Dock = Windows.Forms.DockStyle.Fill; // probably want to fill the element host. Not necessary
somePanel.Controls.Add(es); // add the element host to a panel on your Winform or the form itself

Hope that helps

Ragepotato