@@ -16,22 +16,16 @@ public class ColorProgressBar : System.Windows.Forms.Control
1616 private int _Maximum = 100 ;
1717 private int _Step = 10 ;
1818
19- private Color _BarColor = Color . FromArgb ( 255 , 128 , 128 ) ;
19+ private Color _BarColor = Color . Green ;
2020 private Color _BorderColor = Color . Black ;
2121
22- public enum FillStyles
23- {
24- Solid ,
25- Dashed
26- }
27-
2822 public ColorProgressBar ( )
2923 {
30- base . Size = new Size ( 150 , 15 ) ;
24+ base . Size = new Size ( 200 , 20 ) ;
3125 SetStyle ( ControlStyles . AllPaintingInWmPaint | ControlStyles . ResizeRedraw | ControlStyles . DoubleBuffer , true ) ;
3226 }
3327
34- [ Description ( "ColorProgressBar color" ) ]
28+ [ Description ( "Progress bar color" ) ]
3529 [ Category ( "ColorProgressBar" ) ]
3630 public Color BarColor
3731 {
@@ -46,7 +40,7 @@ public Color BarColor
4640 }
4741 }
4842
49- [ Description ( "The current value for the ColorProgressBar, in the range specified by the Minimum and Maximum properties ." ) ]
43+ [ Description ( "The current value for the progres bar. Must be between Minimum and Maximum." ) ]
5044 [ Category ( "ColorProgressBar" ) ]
5145 [ RefreshProperties ( RefreshProperties . All ) ]
5246 public int Value
@@ -59,22 +53,20 @@ public int Value
5953 {
6054 if ( value < _Minimum )
6155 {
62- throw new ArgumentException ( "'" + value + "' is not a valid value for 'Value'.\n " +
63- "'Value' must be between 'Minimum' and 'Maximum'." ) ;
56+ throw new ArgumentException ( $ "'{ value } ' is not a valid 'Value'.\n 'Value' must be between 'Minimum' and 'Maximum'.") ;
6457 }
6558
6659 if ( value > _Maximum )
6760 {
68- throw new ArgumentException ( "'" + value + "' is not a valid value for 'Value'.\n " +
69- "'Value' must be between 'Minimum' and 'Maximum'." ) ;
61+ throw new ArgumentException ( $ "'{ value } ' is not a valid 'Value'.\n 'Value' must be between 'Minimum' and 'Maximum'.") ;
7062 }
7163
7264 _Value = value ;
7365 this . Invalidate ( ) ;
7466 }
7567 }
7668
77- [ Description ( "The lower bound of the range this ColorProgressbar is working with ." ) ]
69+ [ Description ( "The lower bound of the range." ) ]
7870 [ Category ( "ColorProgressBar" ) ]
7971 [ RefreshProperties ( RefreshProperties . All ) ]
8072 public int Minimum
@@ -96,7 +88,7 @@ public int Minimum
9688 }
9789 }
9890
99- [ Description ( "The uppper bound of the range this ColorProgressbar is working with ." ) ]
91+ [ Description ( "The uppper bound of the range." ) ]
10092 [ Category ( "ColorProgressBar" ) ]
10193 [ RefreshProperties ( RefreshProperties . All ) ]
10294 public int Maximum
@@ -118,7 +110,7 @@ public int Maximum
118110 }
119111 }
120112
121- [ Description ( "The amount to jump the current value of the control by when the Step() method is called." ) ]
113+ [ Description ( "The value to move the progess bar when the Step() method is called." ) ]
122114 [ Category ( "ColorProgressBar" ) ]
123115 public int Step
124116 {
@@ -133,7 +125,7 @@ public int Step
133125 }
134126 }
135127
136- [ Description ( "The border color of ColorProgressBar " ) ]
128+ [ Description ( "The border color" ) ]
137129 [ Category ( "ColorProgressBar" ) ]
138130 public Color BorderColor
139131 {
@@ -149,7 +141,7 @@ public Color BorderColor
149141 }
150142
151143 ///
152- /// <summary>Call the PerformStep() method to increase the value displayed by the amount set in the Step property</summary>
144+ /// <summary>Call the PerformStep() method to increase the value displayed by the value set in the Step property</summary>
153145 ///
154146 public void PerformStep ( )
155147 {
@@ -162,7 +154,7 @@ public void PerformStep()
162154 }
163155
164156 ///
165- /// <summary>Call the PerformStepBack() method to decrease the value displayed by the amount set in the Step property</summary>
157+ /// <summary>Call the PerformStepBack() method to decrease the value displayed by the value set in the Step property</summary>
166158 ///
167159 public void PerformStepBack ( )
168160 {
@@ -175,7 +167,7 @@ public void PerformStepBack()
175167 }
176168
177169 ///
178- /// <summary>Call the Increment() method to increase the value displayed by an integer you specify </summary>
170+ /// <summary>Call the Increment() method to increase the value displayed by the passed value </summary>
179171 ///
180172 public void Increment ( int value )
181173 {
@@ -188,7 +180,7 @@ public void Increment(int value)
188180 }
189181
190182 //
191- // <summary>Call the Decrement() method to decrease the value displayed by an integer you specify </summary>
183+ // <summary>Call the Decrement() method to decrease the value displayed by the passed value </summary>
192184 //
193185 public void Decrement ( int value )
194186 {
@@ -236,8 +228,7 @@ protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
236228
237229 protected void DrawBorder ( Graphics g )
238230 {
239- Rectangle borderRect = new Rectangle ( 0 , 0 ,
240- ClientRectangle . Width - 1 , ClientRectangle . Height - 1 ) ;
231+ Rectangle borderRect = new Rectangle ( 0 , 0 , ClientRectangle . Width - 1 , ClientRectangle . Height - 1 ) ;
241232 g . DrawRectangle ( new Pen ( _BorderColor , 1 ) , borderRect ) ;
242233 }
243234 }
0 commit comments