Esempio n. 1
0
        public void SetBounds(int Left, int Top, int Width, int Height, bool finish)
        {
            if (finish)
            {
                FLeft   = Left;
                FTop    = Top;
                FWidth  = Width;
                FHeight = Height;
                if (OnSetBounds != null)
                {
                    OnSetBounds(new Rectangle(Left, Top, Width, Height));
                }
            }
            TopBar.SetBounds(Left, Top, Width, 1);
            LeftBar.SetBounds(Left, Top, 1, Height);
            BottomBar.SetBounds(Left, Top + Height - 1, Width, 1);
            RightBar.SetBounds(Left + Width - 1, Top, 1, Height);
            int squarewidth = 8;

            if (Action == ResizeAction.Resize)
            {
                Q2.Visible = true;
                Q3.Visible = true;
                Q4.Visible = true;
            }
            else
            {
                Q2.Visible  = false;
                Q3.Visible  = false;
                Q4.Visible  = false;
                squarewidth = 16;
            }
            int squaremid = squarewidth / 2;

            Q1.SetBounds(Left - squaremid, Top - squaremid, squarewidth, squarewidth);
            Q2.SetBounds(Left + Width - squaremid, Top - squaremid, squarewidth, squarewidth);
            Q3.SetBounds(Left + Width - squaremid, Top + Height - squaremid, squarewidth, squarewidth);
            Q4.SetBounds(Left - squaremid, Top + Height - squaremid, squarewidth, squarewidth);
        }