从网上看到了一个窗体拖动事件超级简洁至少现在这个阶段我是看起来有困难的有兴趣的哥们们可以讨论下using Systemusing SystemCollectionsGenericusing SystemComponentModel
using SystemDatausing SystemDrawingusing SystemTextusing SystemWindowsFormsnamespace WindowsApplication{ public partial class Form Form
{ private const int WM_NCHITTEST = x//这几行真够晕的貌似调用了基本函数饿
private const int HTCLIENT = x private const int HTCAPTION = x public Form()
{ InitializeComponent() } protected override void WndProc(ref Message m)
{ switch (mMsg)
{ case WM_NCHITTEST baseWndProc(ref m)
if ((int)mResult == HTCLIENT) mResult = (IntPtr)HTCAPTION return break }
baseWndProc(ref m) } }}
我试过了可以运行就是貌似最后那个break有点问题看不懂……嘿嘿 还得继续努力啊!