WindowsFormsHost wfh = new WindowsFormsHost(); F.Panel panel1 = new F.Panel(); Grid MainGrid = new Grid(); MainGrid.Children.Add(wfh); TabItem Tab = new TabItem(); Tab.Content = MainGrid; MyTabContainer.Items.Add(Tab); ProcessStartInfo psi = new ProcessStartInfo(@"c:\app\myWPFapp.exe"); Process p = Process.Start(psi); for (int i = 0; i < 1000; i++) { System.Threading.Thread.Sleep(10); p.Refresh(); if (p.MainWindowHandle != IntPtr.Zero) { break; } } SetParent(p.MainWindowHandle, panel1.Handle); ShowWindow(p.MainWindowHandle, SW_SHOWMAXIMIZED); Tab.Focus();
MSDN[^]:An element that allows you to host a Windows Forms control on a WPF page.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)