无边框窗体拖动问题

小伙伴程序设计 小伙伴程序设计 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
定义了一个类:
    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;
}
}
}

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

请问高手,我应该要怎么实现这一的功能呢?
...全文
评论 10
收藏 已收藏
分享
返回顶部
小伙伴程序设计
C# 111,128 成员 642,537 内容