WINFORM 把窗体的边框设置为NONE后,还怎么拖动窗体呢?又怎么样调整窗体大小呢?谢谢阿,我菜鸟……13... 30
WINFORM把窗体的边框设置为NONE后,还怎么拖动窗体呢?又怎么样调整窗体大小呢?谢谢阿,我菜鸟……1332393029@qq.com...
WINFORM 把窗体的边框设置为NONE后,还怎么拖动窗体呢?又怎么样调整窗体大小呢?谢谢阿,我菜鸟……1332393029@qq.com
展开
5个回答
展开全部
private void userForm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
this.point = newPoint(e.X, e.Y);
Formform = (Form) sender;
form.MouseMove += newMouseEventHandler(this.userForm_MouseMove);
}
}
private void userForm_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Formform = (Form) sender;
form.MouseMove -= newMouseEventHandler(this.userForm_MouseMove);
}
}
private void userForm_MouseMove(object sender, MouseEventArgs e)
{
Formform = (Form) sender;
intx = (form.Location.X + e.X) - this.point.X;
inty = (form.Location.Y + e.Y) - this.point.Y;
form.Location = newPoint(x, y);
}
{
if (e.Button == MouseButtons.Left)
{
this.point = newPoint(e.X, e.Y);
Formform = (Form) sender;
form.MouseMove += newMouseEventHandler(this.userForm_MouseMove);
}
}
private void userForm_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Formform = (Form) sender;
form.MouseMove -= newMouseEventHandler(this.userForm_MouseMove);
}
}
private void userForm_MouseMove(object sender, MouseEventArgs e)
{
Formform = (Form) sender;
intx = (form.Location.X + e.X) - this.point.X;
inty = (form.Location.Y + e.Y) - this.point.Y;
form.Location = newPoint(x, y);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
貌似不可以吧,最多就是把边框给隐藏起来,激活窗体后再显示出来。在窗体的事件里处理这些问题。你的意图何在?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
给Form1增加一个onmousedown事件,事件里创建一个timer每0.1秒来获取鼠标当前坐标,然后根据鼠标的坐标位置移动form1的postion
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
可以后台写代码解决这个问题 !其实很简单的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
自己编写处理程序,用win32 api
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询