+ if (value != ProgressBarStyle.Blocks && value != ProgressBarStyle.Continuous
+ && value != ProgressBarStyle.Marquee)
+ throw new InvalidEnumArgumentException ("value", unchecked((int)value), typeof (ProgressBarStyle));
+ if (style != value) {
+ style = value;
+
+ if (style == ProgressBarStyle.Marquee) {
+ if (marquee_timer == null) {
+ marquee_timer = new Timer ();
+ marquee_timer.Interval = 10;
+ marquee_timer.Tick += new EventHandler (marquee_timer_Tick);
+ }
+ marquee_timer.Start ();
+ } else {
+ if (marquee_timer != null) {
+ marquee_timer.Stop ();
+ }
+ Refresh ();
+ }
+ }
+ }
+ }
+
+ void marquee_timer_Tick (object sender, EventArgs e)
+ {
+ Invalidate ();
+ }
+
+ int marquee_animation_speed = 100;
+ [DefaultValue (100)]
+ public int MarqueeAnimationSpeed {
+ get {
+ return marquee_animation_speed;
+ }
+
+ set {
+ marquee_animation_speed = value;