龙人在线
about me

Arron

抛砖只为引玉(QQ长期隐身在线)
不能富贵难成大器皆因懒,
胸无大志庸庸碌碌只为闲。

这里是我平时收集的和写的一些东西,希望和大家一起共同进步!

无聊看看电影 边听音乐边看 有空多交流
Google_search
Google
hot
latest
photos
还你真实的开幕式!震撼美图[转]【连载】 央行今日发行600万张面额10元奥运纪念钞(组图) 巧遇日本妹妹海滩拍片片 诱不可挡超级丰胸大美人
links
龙人在线 >> 学习资料 >> .NET专栏 >> 重画label ,使其背景透明

重画label ,使其背景透明

来源:原创 作者:arron 日期:2008-03-05 热度:

两Label重帖,背景透明
效果如图:


同学帮忙搞定的

 

程序代码 程序代码
public   class   myLabel   :   Label  
  {  
      protected   override   void   InitLayout()  
      {  
        base.InitLayout   ();  
        SetLabelTransparence();  
      }  
    
    
      private   void   SetLabelTransparence()  
      {          
        System.Drawing.Drawing2D.GraphicsPath   path   =   new   System.Drawing.Drawing2D.GraphicsPath();  
        path.AddString(this.Text,  
          this.Font.FontFamily,  
          (int)(FontStyle.Bold),  
          this.Font.Size,  
          new   Point(this.ClientRectangle.Left,this.ClientRectangle.Top),  
          new   StringFormat());  
        this.BackColor   =   this.ForeColor;  
        this.Region   =   new   Region(path);  
      }  
  }

Tags: 重画label ,使其背景透明
广告位招租,广告代号:gg468
search
站内
advertise
Copyright © www.jx19.Com All rights reserved.