본문 바로가기
C#/컨트롤

[Form] 타이틀바 잡지않고 폼이동

by izen8 2012. 1. 9.
반응형






public partial class Form1 : Form

{

[DllImportAttribute("user32.dll")]

public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);

[DllImportAttribute("user32.dll")]

public static extern bool ReleaseCapture();

public Form1()

{

InitializeComponent();

}

private void Form1_MouseDown(object sender, MouseEventArgs e)

{

if(e.Button == MouseButtons.Left)

{

ReleaseCapture();

SendMessage(this.Handle, 0xA1, 2, 0);

}

}

}

반응형

댓글