Microsoft.VisualStudio.Project.NativeMethods.SetParent C# (CSharp) Method

SetParent() private method

private SetParent ( IntPtr hWnd, IntPtr hWndParent ) : IntPtr
hWnd System.IntPtr
hWndParent System.IntPtr
return System.IntPtr
        public static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);

Usage Example

Esempio n. 1
0
        public virtual void Activate(IntPtr parent, RECT[] pRect, int bModal)
        {
            if (this.panel == null)
            {
                if (pRect == null)
                {
                    throw new ArgumentNullException("pRect");
                }

                this.panel         = new Panel();
                this.panel.Size    = new Size(pRect[0].right - pRect[0].left, pRect[0].bottom - pRect[0].top);
                this.panel.Text    = SR.GetString(SR.Settings, CultureInfo.CurrentUICulture);
                this.panel.Visible = false;
                this.panel.Size    = new Size(550, 300);
                this.panel.CreateControl();
                NativeMethods.SetParent(this.panel.Handle, parent);
            }

            if (this.grid == null && this.project != null && this.project.Site != null)
            {
                IVSMDPropertyBrowser pb = this.project.Site.GetService(typeof(IVSMDPropertyBrowser)) as IVSMDPropertyBrowser;
                Assumes.Present(pb);
                this.grid = pb.CreatePropertyGrid();
            }

            if (this.grid != null)
            {
                this.active = true;


                Control cGrid = Control.FromHandle(new IntPtr(this.grid.Handle));

                cGrid.Parent   = Control.FromHandle(parent);//this.panel;
                cGrid.Size     = new Size(544, 294);
                cGrid.Location = new Point(3, 3);
                cGrid.Visible  = true;
                this.grid.SetOption(_PROPERTYGRIDOPTION.PGOPT_TOOLBAR, false);
                this.grid.GridSort = _PROPERTYGRIDSORT.PGSORT_CATEGORIZED | _PROPERTYGRIDSORT.PGSORT_ALPHABETICAL;
                NativeMethods.SetParent(new IntPtr(this.grid.Handle), this.panel.Handle);
                UpdateObjects();
            }
            RegisterProjectEvents();
        }
All Usage Examples Of Microsoft.VisualStudio.Project.NativeMethods::SetParent