开发环境:VS2005
开发语言:C#我在自己定义的窗体上添加 [能通过鼠标拖动改变窗体大小功能]时遇到了一下问题。1 鼠标和窗体改变不同步2 鼠标在快速滑动经过边框时,鼠标的样式 从defalut--->变成sizeNe-->但是经过能拖动的
  区域后不能变回defalut。请高手指点:代码如下:
private void BaseForm_MouseDown(object sender, MouseEventArgs e)
        {
            this.MouseStartPositionX = e.X;
            this.MouseStartPositionY = e.Y;
            this.ButtonPress = true;
            if (e.X > this.Width - 2 && e.Y < this.Height - 2)
            {
                this.MoveStatus = 1;
            }
            else if (e.X > this.Width - 2 && e.Y > this.Height - 2)
            {
                this.moveStatus = 2;
            }
            else if (e.Y > this.Height - 2 && e.X < this.Width - 2)
            {
                this.moveStatus = 3;
            }
            else
            {
                this.Cursor = Cursors.Default;
                this.moveStatus = 0;
                this.ButtonPress = false;
            }
            this.FormWith = this.Width;
            this.Formheight = this.Height;
        }
        int mi = 1;
        private void BaseForm_MouseMove(object sender, MouseEventArgs e)
        {
            this.MouseEndPositionX = e.X;
            this.MouseEndPositionY = e.Y;
            //if (e.X < this.Width - 5 && e.Y < this.Height - 5)
            //{
            //    this.Cursor = Cursors.Default;
            //}            if (e.X > this.Width - 2 && e.Y < this.Height - 2)
            {
                this.Cursor = Cursors.SizeWE;
                
            }
            else if (e.X > this.Width - 2 && e.Y > this.Height - 2)
            {
                this.Cursor = Cursors.SizeNWSE;            }
            else if (e.Y > this.Height - 2 && e.X < this.Width - 2)
            {
                this.Cursor = Cursors.SizeNS;            }
            else
            {
                this.Cursor = Cursors.Default;
            }            if (this.ButtonPress)
            {
                if (mi > 20)
                {
                    int m = this.FormWith + this.mouseEndPositionX - this.mouseStartPositionX;
                    int n = this.Formheight + this.mouseEndPositionY - this.mouseStartPositionY;
                    this.Size = new Size(m, n);
                    mi = 1;
                }            }
            mi = mi + 1;
        }        private void BaseForm_MouseUp(object sender, MouseEventArgs e)
        {
            this.Cursor = Cursors.Default;
            this.ButtonPress = false;
            this.MoveStatus = 0;
        }