Return to Snippet

Revision: 20619
at November 20, 2009 05:05 by wearetherock


Initial Code
// Declair
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;

[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd,int Msg, int wParam, int lParam);
        
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();


// Use
private void AgentForm_MouseDown(object sender, MouseEventArgs e){
    if (e.Button == MouseButtons.Left){
                ReleaseCapture();
                SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
            }
    }
}

Initial URL

                                

Initial Description

                                

Initial Title
Move without Title

Initial Tags
c

Initial Language
C#