示例#1
0
        public override void OnParentChanged(EventArgs e)
        {
            base.OnParentChanged(e);

            int leftDist  = 150;
            int rightDist = 320;

            anchorLeft.OriginRelativeParent = new Vector2(leftDist, 290);
            anchorLeft.Margin  = new BorderDouble(leftDist, 0, 0, 0);
            anchorLeft.HAnchor = HAnchor.Left;

            anchorAll.OriginRelativeParent = new Vector2(leftDist, 330);
            anchorAll.AnchorAll();

            anchorLeftCentered.OriginRelativeParent = new Vector2(leftDist, 250);
            anchorLeftCentered.HAnchor = HAnchor.Left;

            anchorRight.OriginRelativeParent = new Vector2(leftDist, 210);
            anchorRight.HAnchor = HAnchor.Right;

            anchorLeftRight.OriginRelativeParent = new Vector2(leftDist, 170);
            anchorLeftRight.HAnchor = HAnchor.Right | HAnchor.Left;

            anchorLeftRightCenter.OriginRelativeParent = new Vector2(leftDist, 130);
            anchorLeftRightCenter.HAnchor = HAnchor.Right | HAnchor.Left;

            anchorLeftRightRight.OriginRelativeParent = new Vector2(leftDist, 100);
            anchorLeftRightRight.HAnchor = HAnchor.Right | HAnchor.Left;

            anchorBottom.OriginRelativeParent = new Vector2(rightDist, 290);
            anchorBottom.VAnchor = VAnchor.Bottom;

            anchorTop.OriginRelativeParent = new Vector2(rightDist, 250);
            anchorTop.VAnchor = VAnchor.Top;

            //anchorBottomTop.OriginRelativeParent = new Vector2(rightDist, 210);
            //anchorBottomTop.AnchorFlags = AnchorFlags.Top | AnchorFlags.Bottom;
        }