Ejemplo n.º 1
0
        public void RecenterControls()
        {
            BoxPokeGrid.HorizontallyCenter(this);
            int p1 = CB_BoxSelect.Location.X;

            CB_BoxSelect.HorizontallyCenter(this);
            int p2 = CB_BoxSelect.Location.X;

            if (p1 == p2)
            {
                return;
            }

            B_BoxLeft.Location  = new Point(B_BoxLeft.Location.X + p2 - p1, B_BoxLeft.Location.Y);
            B_BoxRight.Location = new Point(B_BoxRight.Location.X + p2 - p1, B_BoxRight.Location.Y);
        }
Ejemplo n.º 2
0
    public void RecenterControls()
    {
        if (Width < BoxPokeGrid.Width)
        {
            Width = BoxPokeGrid.Width;
        }
        BoxPokeGrid.HorizontallyCenter(this);
        int p1 = CB_BoxSelect.Location.X;

        CB_BoxSelect.HorizontallyCenter(this);
        int p2 = CB_BoxSelect.Location.X;

        var delta = p2 - p1;

        if (delta == 0)
        {
            return;
        }

        B_BoxLeft.SetBounds(B_BoxLeft.Location.X + delta, 0, 0, 0, BoundsSpecified.X);
        B_BoxRight.SetBounds(B_BoxRight.Location.X + delta, 0, 0, 0, BoundsSpecified.X);
    }