public class CYBaseControl : Control
    {

        public CYBaseControl()
        {
            this.SetStyle(ControlStyles.SupportsTransparentBackColor |
                ControlStyles.Opaque, true);
            this.BackColor = Color.Transparent;
        }

        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle = 0x20;
                return cp;
            }
        }
    }

  已知问题:该类控件无法启用双缓冲,所以不适合做动态效果,闪烁会很严重;层叠控件时绘制顺序会乱掉,可能是我绘制绘制控件的时候没有做判断顺序的原因

相关文章:

  • 2022-01-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
  • 2021-11-22
  • 2022-01-06
  • 2021-06-28
  • 2021-09-29
猜你喜欢
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-11-20
  • 2021-09-07
  • 2021-06-17
相关资源
相似解决方案