转自原文 C# 鼠标穿透窗体与恢复
引入user32.dll
[DllImport("user32.dll")]
public static extern uint SetWindowLong(IntPtr h, int n, uint x);
使指定窗体穿透,this.Handle为将要设为穿透效果的窗体句柄
SetWindowLong(this.Handle, -20, 0x20 | 0x80000);
恢复
this.FormBorderStyle = this.FormBorderStyle;