* TabControl.cs: Account for the drawing of tabs borders when
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / TabControl.cs
index 471358ef9fda4be6be1b8b0336ecc959b5ae207d..93c602ffc65579c03e1569f0ac8251a5e68bfea5 100644 (file)
@@ -17,7 +17,7 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
-// Copyright (c) 2004 Novell, Inc.
+// Copyright (c) 2004-2005 Novell, Inc.
 //
 // Authors:
 //     Jackson Harper (jackson@ximian.com)
@@ -240,8 +240,12 @@ namespace System.Windows.Forms {
                                        Refresh ();
                                } else {
                                        SizeTabs ();
+                                       // The lines are drawn on the edges of the tabs so the invalid area should
+                                       // needs to include the extra pixels of line width.
+                                       if (appearance == TabAppearance.Normal)
+                                               invalid.Inflate (4, 4);
                                        Invalidate (invalid);
-                                }
+                               }
                        }
                }
 
@@ -453,6 +457,7 @@ namespace System.Windows.Forms {
                                        } else {
                                                Invalidate (right);
                                        }
+                                       return;
                                } else if (left.Contains (e.X, e.Y)) {
                                        left_slider_state = ButtonState.Pushed;
                                        if (CanScrollLeft) {
@@ -462,6 +467,7 @@ namespace System.Windows.Forms {
                                        } else {
                                                Invalidate (left);
                                        }
+                                       return;
                                }
                        }