zoukankan      html  css  js  c++  java
  • winform中真正的透明label

    winform中的透明都是假透明,只是将背景色设置为父级容器的背景色。所以从网上找到这个真正透明的label。

     1 public partial class transparentLabel : UserControl
     2     {
     3         public transparentLabel()
     4         {
     5             InitializeComponent();
     6             SetStyle(ControlStyles.SupportsTransparentBackColor
     7               | ControlStyles.UserPaint
     8               | ControlStyles.AllPaintingInWmPaint
     9               | ControlStyles.Opaque, true);
    10             this.BackColor = Color.Transparent;
    11         }
    12         protected override CreateParams CreateParams
    13         {
    14             get
    15             {
    16                 CreateParams cp = base.CreateParams;
    17                 cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT 
    18                 return cp;
    19             }
    20 
    21         }
    22     }
  • 相关阅读:
    struts2.0利用注解上传和下载图片
    hibernate @ManyToOne
    Cookie会话管理
    ServletContext
    Servlet 1
    ArrayList
    BigInteger类和BigDecimal类
    Math类
    System类
    基本类型包装类
  • 原文地址:https://www.cnblogs.com/strongZZ/p/4470488.html
Copyright © 2011-2022 走看看