自定义透明层控件

作者:互联网   出处:控件中国网   2014-11-05 19:21:18   阅读:1

自定义透明层控件

        public TransparentLayer()
        {
            InitializeComponent();
            SetStyle(ControlStyles.SupportsTransparentBackColor |   ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque , true);
            this.BackColor = Color.Transparent;
        }
        protected override void OnLocationChanged(EventArgs e)
        {
            Visible = false;
            Visible = true;
        }
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x00000020;
                return cp;
            }
        }
 

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat