具體代碼如下所示:
#region 無邊框拖動(dòng)效果 [DllImport("user32.dll")]//拖動(dòng)無窗體的控件 public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam); public const int WM_SYSCOMMAND = 0x0112; public const int SC_MOVE = 0xF010; public const int HTCAPTION = 0x0002; private void Start_MouseDown(object sender, MouseEventArgs e) { //拖動(dòng)窗體 ReleaseCapture(); SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, 0); } #endregion在窗口屬性界面添加事件服務(wù)

總結(jié)
以上所述是小編給大家介紹的C# 實(shí)現(xiàn)窗口無邊框,可拖動(dòng)效果,希望對(duì)大家有所幫助,如果大家有任何疑問請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選