|
板凳
楼主 |
发表于 2012-11-21 14:34:08
|
只看该作者
[code=csharp]public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Win32.ReleaseCapture();
Win32.SendMessage(Handle, 274, 61440 + 9, 0);
}
}
}
[/code]
Api
[code=csharp] public class Win32
{
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
}[/code]
|
|