示例#1
0
        protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified)
        {
            if ((specified & BoundsSpecified.Size) != 0)
            {
                if (_window != null)
                {
                    Size size;
                    ErrorUtil.ThrowOnFailure(_window.GetPreferredSize(
                                                 new Size(width, height), out size
                                                 ));

                    width  = size.Width;
                    height = size.Height;
                }
                else if (_designMode)
                {
                    height = 23;
                }
            }

            base.SetBoundsCore(x, y, width, height, specified);
        }