首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

无边框窗体拖动有关问题

2012-09-21 
无边框窗体拖动问题定义了一个类:C# codeclass DragForm{private int xprivate int yprivate Point yyy

无边框窗体拖动问题
定义了一个类:  

C# code
    class DragForm    {        private int x;        private int y;        private Point yyy;        private bool _t;        public bool t        {            get { return t; }            set { _t = value; }        }        public void setXy(Control f)        {            yyy =f.PointToClient(Control.MousePosition);        }        public void dragForm(Control f)        {            Point xxx = Control.MousePosition;            x = xxx.X;            y = xxx.Y;            if (_t == true)            {                f.Top = y - yyy.Y;                f.Left = x - yyy.X;            }        }    }

类的作用是拖动窗体,但是我可以实现拖动。无法实现像普通有边框窗体拖动时有一个灰色边框的效果。
比如下图~

请问高手,我应该要怎么实现这一的功能呢?

[解决办法]
用标准方法:
如何通过拖动窗体的工作区来移动窗体

热点排行