public void Show() { // For Dot net control user need to create object at every Display //WinForm Control MyWinFormControl = new Form1(); //If you are adding Winform in Property Page need to set TopLevel Property to false MyWinFormControl.TopLevel = false; MyWinFormControl.Show(); dotnet1.SetWindowHandle(MyWinFormControl.Handle.ToInt64()); //User Control MyUserControl = new UserControl1(); dotnet2.SetWindowHandle(MyUserControl.Handle.ToInt64()); //WPF control elhost = new ElementHost(); MyWPFControl = new WPFControl(); elhost.Child = MyWPFControl; dotnet3.SetWindowHandle(elhost.Handle.ToInt64()); //Show Proppety page swPropertyPage.Show(); }
public void WPFInModelView() { IModelDoc2 pDoc; pDoc = (IModelDoc2)iSwApp.ActiveDoc; IModelViewManager swModelViewMgr; swModelViewMgr = pDoc.ModelViewManager; WpfModelView1Control = new WPFControl(); ModelViewelhost = new ElementHost(); ModelViewelhost.Child = WpfModelView1Control; swModelViewMgr.DisplayWindowFromHandle(".NET WPF Control", ModelViewelhost.Handle.ToInt64(), true); }