C#通过控件拖动窗口

http://www.cnblogs.com/muchme/p/4381327.html

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); 

private void pictureBox1_MouseDown(object sender, MouseEventArgs e) 
{ 
ReleaseCapture(); 
SendMessage(this.Handle, 0x0112, 0xF012, 0); 
} 

 

posted on 2015-03-31 16:36  Xiao灬明b  阅读(248)  评论(0)    收藏  举报

导航