日期:2010-01-05  浏览次数:20994 次

  1. using System; 
  2. using System.Windows.Forms; 
  3. using System.Drawing; 
  4. using System.ComponentModel; 
  5.  
  6. namespace WindowsApplication4 
  7. { 
  8.     /// <summary> 
  9.     /// Summary description for CustomColorRadioButton. 
  10.     /// </summary> 
  11.     public class CustomColorRadioButton : RadioButton 
  12.     { 
  13.         // Fields 
  14.         private Color checkColor; 
  15.  
  16.         public CustomColorRadioButton() 
  17.         { 
  18.             this.checkColor = this.ForeColor; 
  19.             this.Paint += new PaintEventHandler(this.PaintHandler); 
  20.         } 
  21.  
  22.         [Description("The color used to display the check painted in the RadioButton")] 
  23.         public Color CheckColor  
  24.         { 
  25.             get  
  26.             { 
  27.                 return checkColor; 
  28.             } 
  29.             set  
  30.             { 
  31.                &nbs