[Mono-bugs] [Bug 78121][Nor] New - [PATCH] ArgumentOutOfRangeException using TabControl.TabPages.Clear ()

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Apr 16 03:34:05 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gert.driesen at pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=78121

--- shadow/78121	2006-04-16 03:34:05.000000000 -0400
+++ shadow/78121.tmp.23217	2006-04-16 03:34:05.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 78121
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: gert.driesen at pandora.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [PATCH] ArgumentOutOfRangeException using TabControl.TabPages.Clear ()
+
+A recent regression in SWF causes the following exception when clearing the
+tab pages on a tab control:
+
+Unhandled Exception: System.ArgumentOutOfRangeException: ControlCollection
+does not have that many controls
+Parameter name: index
+-1
+in <0x0010a> System.Windows.Forms.Control+ControlCollection:get_Item (Int32
+index)
+in <0x00021> System.Windows.Forms.TabControl:GetTab (Int32 index)
+in (wrapper remoting-invoke-with-check)
+System.Windows.Forms.TabControl:GetTab (int)
+in <0x00013> System.Windows.Forms.TabControl+TabPageCollection:get_Item
+(Int32 index)
+in <0x000da> System.Windows.Forms.TabControl:set_SelectedIndex (Int32 value)
+in (wrapper remoting-invoke-with-check)
+System.Windows.Forms.TabControl:set_SelectedIndex (int)
+in <0x00129> System.Windows.Forms.TabControl+ControlCollection:Remove
+(System.Windows.Forms.Control value)
+in <0x000b0> System.Windows.Forms.Control+ControlCollection:RemoveAt (Int32
+index)
+in <0x00033> System.Windows.Forms.Control+ControlCollection:Clear ()
+in <0x0001a> System.Windows.Forms.TabControl+TabPageCollection:Clear ()
+in <0x00062> Test:Main ()
+
+To reproduce, compile and run the following code snippet:
+
+using System.Windows.Forms;
+
+public class Test {
+        static void Main() {
+                TabControl tab = new TabControl ();
+                tab.Controls.Add (new TabPage ());
+                tab.TabPages.Clear();
+        }
+}
+
+I'll attach a patch which fixes this issue, and adds a unit test for it.


More information about the mono-bugs mailing list