C# Winform 让整个窗口都可以拖动
发布时间:2020-12-15 05:43:44 所属栏目:百科 来源:网络整理
导读:今天在网上查一些资料的时候,无意中发现另一种办法,非常方便,调用系统的 API 来实现的,效果也很好. 赶紧收藏了~ 复制代码 代码如下: [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern
今天在网上查一些资料的时候,无意中发现另一种办法,非常方便,调用系统的 API 来实现的,效果也很好. 赶紧收藏了~ 复制代码 代码如下: [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd,int wMsg,int wParam,int lParam); private void frmMain_MouseDown(object sender,MouseEventArgs e) { ReleaseCapture(); SendMessage(this.Handle,0x0112,0xF012,0); } 您可能感兴趣的文章:
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |