天天看點

Winform 使用panel 自定義拖動窗體

private  void panel1_MouseDown(object sender,  MouseEventArgs
       {
FromCustomStyle.MoveForm(this, this.panel1);
        }
///<summary>
///拖動Panel 窗體移動
///</summary>
///<param name="form1">視窗執行個體</param>
///<param name="panel1">要拖動的Panel</param>
public  static void MoveForm(Form form1,System.Windows.Forms.Panel
       {
            ReleaseCapture();
//*********************調用移動無窗體控件函數  
 
       }
//定義無邊框窗體Form  
DllImport("user32.dll")]//*********************拖動無窗體的控件  
public  static extern bool
DllImport("user32.dll")]
public  static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int
public  const int
public  const int
public const int