在窗体form代码中加入如下代码即可:

 protected override CreateParams CreateParams
        {

            get
            {

                CreateParams cp = base.CreateParams;

                cp.ExStyle |= 0x02000000;

                return cp;

            }

        }

UserControl的Code

protected override CreateParams CreateParams {
  get {
    var parms = base.CreateParams;
    parms.Style &= ~0x02000000;  // Turn off WS_CLIPCHILDREN
    return parms;
  }
}

  

posted on 2018-04-05 10:18  未完代码  阅读(577)  评论(0编辑  收藏  举报