[转]C# WInForm 无框窗体移动
来源:互联网 发布:php webservice 调用 编辑:程序博客网 时间:2024/06/05 14:09
本文转自:http://hi.baidu.com/yore2003/blog/item/f385df22377156f5d6cae239.html
调用API
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
在空间的_MouseDown中加入如下代码:
如:
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0);
}
- [转]C# WInForm 无框窗体移动
- C# WInForm 无框窗体移动
- c# winform移动无边框窗体
- C# winform中无边框窗体的移动
- C# winform 无边框窗体鼠标点击移动事件
- C# winform 无边框窗体鼠标点击移动事件
- WinForm 移动无边框窗体
- winform无标题栏移动窗体
- winform移动无边框窗体
- Winform 无标题栏可以移动窗体
- WinForm之无边框窗体的移动
- C# 无边框窗体移动
- C# 移动无边框窗体
- c#移动无边框窗体
- 无框窗体移动
- WinForm 无边框窗体 拖动工作区移动窗体
- WinForm 无边框窗体 拖动工作区移动窗体
- C# WinForm 拖动无边框窗体
- c# winForm TableLayoutPanel学习 合并行的布局及动态增加删除内部控件
- C# WinForm 使用FlowLayoutPanel控件做为导航菜单按钮的容器
- [转]C# WinForm 绘制圆角窗体
- [转]c# 根据URL定位InternetCache中文件的位置
- c# winForm 将窗体状态栏StatusStrip 分成左中右三部分 右边显示当前时间
- [转]C# WInForm 无框窗体移动
- [文摘20081023]童言无忌的最高境界
- VB C# 在线互译 .net code converter
- c# 创建指定大小的空字符填充的文本文件 在指定位置读写相关内容
- [转]C#基础学习--异步编程篇
- [文摘20081021]明年粮食最低收购价将大幅提高 最高幅度达15.3%
- [转]C#断点续传
- [转]灰度图像的腐蚀算法和细化算法(C#代码)
- [转]去噪:用于验证码图片识别的类续(C#代码)