* TabControl.cs:
authorJackson Harper <jackson@novell.com>
Thu, 27 Jan 2005 08:29:47 +0000 (08:29 -0000)
committerJackson Harper <jackson@novell.com>
Thu, 27 Jan 2005 08:29:47 +0000 (08:29 -0000)
- Only invalidate the effected tabs when the
selected index changes. This reduces drawing and gets rid of some
flicker.
- Only refresh if the tabs need to be shifted, otherwise only
invalidate the slider button.

svn path=/trunk/mcs/; revision=39624

mcs/class/Managed.Windows.Forms/System.Windows.Forms/TabControl.cs

index f20ae10c15ba5eab32fc23314a9a50b866a82bdf..e52293e86fc167418cb659a9021c66f5d91b030c 100644 (file)
@@ -409,19 +409,20 @@ namespace System.Windows.Forms {
                                        if (CanScrollRight) {
                                                slider_pos++;
                                                SizeTabs ();
+                                               Refresh ();
+                                       } else {
+                                               Invalidate (right);
                                        }
-                                       Refresh ();
-                                       return;
                                } else if (left.Contains (e.X, e.Y)) {
                                        left_slider_state = ButtonState.Pushed;
                                        if (CanScrollLeft) {
                                                slider_pos--;
                                                SizeTabs ();
+                                               Refresh ();
+                                       } else {
+                                               Invalidate (left);
                                        }
-                                       Refresh ();
-                                       return;
                                }
-
                        }
 
                        int count = Controls.Count;