一个自定义LABEL组件的C#源代码

2016-01-29 13:36 127 1 收藏

一个自定义LABEL组件的C#源代码,一个自定义LABEL组件的C#源代码

【 tulaoshi.com - ASP.NET 】

using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;

namespace wzsbmain
{
 /// <summary
 /// Summary description for LabelGradient.
 /// </summary
  
 public class wzsbmainLabel : System.Windows.Forms.Label
 {
  
  #region Implementtation Member Fields
  protected Color gradientColorOne = Color.White;
  protected Color gradientColorTwo = Color.Blue;
  protected LinearGradientMode lgm = LinearGradientMode.ForwardDiagonal;
  protected Border3DStyle b3dstyle = Border3DStyle.Bump;
  #endregion

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)

  #region GradientColorOne Properties
  [
  DefaultValue(typeof(Color),"White"),
  Description("The first gradient color."),
  Category("Appearance"),
  ]

   //GradientColorOne Properties
  public Color GradientColorOne
  {
   get
   {
    return gradientColorOne;
   }
   set
   {
    gradientColorOne = value;
    Invalidate();
   }
  }
  #endregion
  
  #region GradientColorTwo Properties
  [
  DefaultValue(typeof(Color),"Blue"),
  Description("The second gradient color."),
  Category("Appearance"),
  ]

   //GradientColorTwo Properties
  public Color GradientColorTwo
  {
   get
   {
    return gradientColorTwo;
   }
   set
   {
    gradientColorTwo = value;
    Invalidate();
   }
  }

  #endregion

  #region LinearGradientMode Properties
  //LinearGradientMode Properties
  [
  DefaultValue(typeof(LinearGradientMode),"ForwardDiagonal"),
  Description("Gradient Mode"),
  Category("Appearance"),
  ]
  
  public LinearGradientMode GradientMode
  {
   get
   {
    return lgm;
   }
   
   set
   {
    lgm = value;
    Invalidate();
   }
  }
  #endregion
       
  #region Border3DStyle Properties
  //Border3DStyle Properties
  [
  DefaultValue(typeof(Border3DStyle),"Bump"),
  Description("BorderStyle"),
  Category("Appearance"),
  ]

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)

   // hide BorderStyle inherited from the base class
  new public Border3DStyle BorderStyle
  {
   get
   {
    return b3dstyle;
   }
   set
   {
    b3dstyle = value;
    Invalidate();
   }
  }
  #endregion

  #region Removed Properties
  
  // Remove BackColor Property
  [
  Browsable(false),
  EditorBrowsable(EditorBrowsableState.Never)
  ]
  public override System.Drawing.Color BackColor
  {
   get 
   {
    return new System.Drawing.Color();
 

来源:http://www.tulaoshi.com/n/20160129/1490775.html

延伸阅读
using System; using System.Net; using System.IO; using System.Text; using System.Net.Sockets; namespace zhangyuk.net.csdn.blog.ftpclient {  /// <summary  /// FTP Client  /// </summary  public class FTPClient  {   #region 构造函数   /// <summary   /// 缺省构造函数  ...
标签: ASP
  ' 打开数据库 Set Con = Server.CreateObject("ADODB.Connection") Con.Open "asp" , Application("ConASP_RuntimeUserName") , Application("ConASP_RuntimePassword") Set RecBBS = Server.CreateObject("ADODB.RecordSet") Set RecReply = Server.CreateObject("ADODB.Reco...
标签: ASP
  '============================== Case "Write" '============================== ' 发表文章 % <TABLE align=center border=0 cellPadding=7 cellSpacing=0 width=650 <TR <TD class=menu <P<A href="/"飞林庄</A-&gt;<A href="<%= ASP_FILE_NAME %"经验交流</A</P...
标签: ASP
  '================================= Case "Modify" '================================ ' 修改文章 Which = Request("Which") WhichID = GetID( Which ) If Left( Which , 1 ) = "E" Then Table = "bbs" Else Table = "bbsreply" WrongMsg = "" If Request("Mod...
//////////////////////////// //  武汉探索电脑工作室    // //   http://tansuo.51.net  // //////////////////////////// //增加规格自定义纸张 //PaperName: 自定义纸张名称 //PaperWidth: 纸张的宽度,以0.1mm为单位 //PaperLength...

经验教程

986

收藏

45
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部