Exemplo n.º 1
0
        }// ShowMe()

        //
        //
        // ****             AddControl()                ****
        //
        public void AddControl(IEngineControl engineControl)
        {
            this.m_IEngineControl = engineControl;
            engineControl.AcceptPopUp(this);

            Control newControl2 = (Control)engineControl;

            if (this.FormBorderStyle == FormBorderStyle.Sizable ||
                this.FormBorderStyle == FormBorderStyle.SizableToolWindow)
            {   // This window has a grab bar - delete my home-made grab bar.
                this.HeaderHeight = 0;
            }
            else
            {
                this.HeaderHeight = panel1.Height;
            }
            newControl2.Location = new Point(0, HeaderHeight);
            this.Controls.Add(newControl2);
            int maxX = newControl2.Width;
            int maxY = newControl2.Height;

            // Resize popup.
            maxX            = Math.Max(maxX, MinimumAllowedWidth);
            this.ClientSize = new Size(maxX, maxY + HeaderHeight);
        }