【C#】窗体拖拽事件
代码示例:
1 [DllImport("user32.dll", EntryPoint = "ReleaseCapture")] 2 private extern static void ReleaseCapture(); 3 [DllImport("user32.dll", EntryPoint = "SendMessage")] 4 private extern static void SendMessage(System.IntPtr hWnd, int wMsg, int wParam, int lParam); 5 6 /// <summary> 7 /// 拖拽窗体 8 /// </summary> 9 private void Form_User_MouseDown(object sender, MouseEventArgs e) 10 { 11 ReleaseCapture(); 12 SendMessage(this.Handle, 0x112, 0xf012, 0); 13 }
时间:2025年3月14日

窗体拖拽事件
浙公网安备 33010602011771号