using System;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.DrawingD;
using System.ComponentModel; 
namespace wzsbmain
{
 
/// <summary>
 
/// Summary description for LabelGradient.
 
/// </summary>

  
 
public class wzsbmainLabel : System.Windows.Forms.Label
 
{
   
  
Implementtation Member Fields

  
GradientColorOne Properties
  
  
GradientColorTwo Properties

  
LinearGradientMode Properties
        
  
BorderDStyle Properties

  
Removed Properties


  
//  protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
  
//  {
  
//   Graphics gfx = e.Graphics;
  
//   //BorderDStyle bdstyle = BorderDStyle.Bump;
  
//   //BorderDSide bdside = BorderDSide.All;
  
//   
  
//   Rectangle rect = new Rectangle (0,0,this.Width,this.Height);
  
//
  
//   // Dispose of brush resources after use
  
//   using (LinearGradientBrush lgb = new LinearGradientBrush(rect, gradientColorOne,gradientColorTwo,lgm))
  
//   gfx.FillRectangle(lgb,rect);
  
//   
  
//   //d border
  
//   //ControlPaint.DrawBorderD(gfx,rect,bdstyle,bdside);
  
//   
  
//      
  
//   // Call the OnPaint method of the base class
  
//            base.OnPaint(e);
  
//   
  
//  }

  
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
  
{
   Graphics gfx 
= pevent.Graphics;
   
   Rectangle rect 
= new Rectangle (0,0,this.Width,this.Height);
   
   
// Dispose of brush resources after use
   using (LinearGradientBrush lgb = new LinearGradientBrush(rect, gradientColorOne,gradientColorTwo,lgm))
    gfx.FillRectangle(lgb,rect);
   
   ControlPaint.DrawBorderD(gfx,rect,bdstyle);
  }



 }

}



posted on 2007-02-12 13:51  mbskys  阅读(397)  评论(0)    收藏  举报