C# form窗体无边框后,鼠标移动窗体
来源:互联网 发布:我的淘宝卖家旺旺号 编辑:程序博客网 时间:2024/06/04 17:58
#region 无边框,鼠标移动
Point mouseOff;//鼠标移动的坐标
bool leftFalg;//标记为是否为左键选中
private void Main_MouseDown(object sender,MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseOff = new Point(-e.X, -e.Y);//得到变量的值
leftFalg = true;//点击左键,按下鼠标时标记为true
}
}
private void Main_MouseMove(object sender, MouseEventArgs e)
{
if (leftFalg)
{
Point mouseSet = Control.MousePosition;
mouseSet.Offset(mouseOff.X,mouseOff.Y);//设置移动后的坐标
Location = mouseSet;
}
}
private void Main_MouseUp(object sender, MouseEventArgs e)
#endregion
Point mouseOff;//鼠标移动的坐标
bool leftFalg;//标记为是否为左键选中
private void Main_MouseDown(object sender,MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
mouseOff = new Point(-e.X, -e.Y);//得到变量的值
leftFalg = true;//点击左键,按下鼠标时标记为true
}
}
private void Main_MouseMove(object sender, MouseEventArgs e)
{
if (leftFalg)
{
Point mouseSet = Control.MousePosition;
mouseSet.Offset(mouseOff.X,mouseOff.Y);//设置移动后的坐标
Location = mouseSet;
}
}
private void Main_MouseUp(object sender, MouseEventArgs e)
{
if(leftFlag)
{
leftFalg = false;//释放鼠标后标记为false
}
}
//最后绑定事件
#endregion
阅读全文
0 0
- C# form窗体无边框后,鼠标移动窗体
- C# 无边框窗体移动
- C# 移动无边框窗体
- c#移动无边框窗体
- C# winform 无边框窗体鼠标点击移动事件
- c# 无边框窗体鼠标点击移动方法
- C# winform 无边框窗体鼠标点击移动事件
- C# 如何鼠标拖动无边框窗体
- C# 用鼠标拖动无边框窗体
- C# 如何鼠标拖动无边框窗体
- C# Form窗体的功能操作,无边框窗体的移动,无边框窗体的尺寸缩放,保存和恢复窗体的尺寸和坐标信息
- 无边框窗体移动
- C# 无边框窗体的移动
- 使用C#实现移动无边框窗体
- 使用C#实现移动无边框窗体
- 使用C#实现移动无边框窗体
- C#中无边框窗体移动
- C#无边框窗体的移动
- 11月24日学习笔记_map/reduct的应用于使用
- H5移动端横竖屏切换监听 副作用——手机整屏状态下安卓机input 问题
- 谈谈Unicode编码,简要解释UCS、UTF、BMP、BOM等名词
- web项目-Excel文件导出
- 使用Spring JDBC实现mysql的分页查询
- C# form窗体无边框后,鼠标移动窗体
- java微信-企业付款api
- Linux下JDK安装
- 欢迎使用CSDN-markdown编辑器
- LintView点击子控件里面的按钮对应打开或隐藏对应的子控件同类的控件
- winForm制作图片Button
- jsp html 页面 返回上一页
- Java微信开发之现金红包接口
- 指针右左法则----复杂指针解析