...

  public partial class Transwindow : UserControl
    {
        public Transwindow()
        {
            InitializeComponent();
            SetStyle(ControlStyles.SupportsTransparentBackColor
              | ControlStyles.UserPaint
              | ControlStyles.AllPaintingInWmPaint
              | ControlStyles.Opaque, true);
            this.BackColor = Color.Transparent;
        }
        protected override CreateParams CreateParams
        {
            get
            {
                //return base.CreateParams;
                CreateParams cp = base.CreateParams;
                cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
                return cp;
            }
        }
    }

posted @ 2013-08-13 15:32  E1ement  阅读(126)  评论(0编辑  收藏  举报