Ejemplo n.º 1
0
 public void UserControlInModelView()
 {
     IModelDoc2 pDoc;
     pDoc = (IModelDoc2)iSwApp.ActiveDoc;
     IModelViewManager swModelViewMgr;
     swModelViewMgr = pDoc.ModelViewManager;
     ModelView1Control = new UserControl1();
     swModelViewMgr.DisplayWindowFromHandle(".NET User Control1", ModelView1Control.Handle.ToInt64(), false);
 }
Ejemplo n.º 2
0
        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();

        }
Ejemplo n.º 3
0
        public void WinFormInTaskPane()
        {
            ITaskpaneView pTaskPanView;
            pTaskPanView = iSwApp.CreateTaskpaneView2("", "C# .NET Control");
            TaskPanWinFormControl = new Form1();
            pTaskPanView.DisplayWindowFromHandle(TaskPanWinFormControl.Handle.ToInt64());
            TaskPanUserControl = (UserControl1)pTaskPanView.GetControl();
            Debug.Print(TaskPanUserControl.Name);

        }