在窗体form代码中加入如下代码即可:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base .CreateParams;
cp.ExStyle |= 0x02000000;
return cp;
}
}
|
UserControl的Code
1 2 3 4 5 6 7 |
protected override CreateParams CreateParams {
get {
var parms = base .CreateParams;
parms.Style &= ~0x02000000; // Turn off WS_CLIPCHILDREN
return parms;
}
}
|
https://www.cnblogs.com/fuhang/p/8721325.html