protected override void SetBoundsCore(int x, int y,
int width, int height,
BoundsSpecified specified)
{
_requestedDim = (Orientation == Orientation.Horizontal) ? height : width;
if (_autoSize)
{
if (Orientation == Orientation.Horizontal)
{
if ((specified & BoundsSpecified.Height) != BoundsSpecified.None)
height = GetPreferredSize(Size.Empty).Height;
}
else if ((specified & BoundsSpecified.Width) != BoundsSpecified.None)
width = GetPreferredSize(Size.Empty).Width;
}
base.SetBoundsCore(x, y, width, height, specified);
}