[Mono-bugs] [Bug 79847][Maj] New - ArgOutOfRangeEx adding TabControl to Form

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Nov 6 15:53:08 EST 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 monkey at jpobst.com.

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

--- shadow/79847	2006-11-06 15:53:08.000000000 -0500
+++ shadow/79847.tmp.26822	2006-11-06 15:53:08.000000000 -0500
@@ -0,0 +1,100 @@
+Bug#: 79847
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: monkey at jpobst.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ArgOutOfRangeEx adding TabControl to Form
+
+Description of Problem:
+If you add a TabControl to a Form without adding any TabPages to the
+TabControl, it crashes with "System.ArgumentOutOfRangeException:
+ControlCollection does not have that many controls".  It appears to be a
+focus setting issue.
+
+Steps to reproduce the problem:
+1. Run attached program.
+
+Expected Results:
+Form displays with a TabControl without any TabPages.
+
+Additional Information:
+Stacktrace:
+Unhandled Exception: System.ArgumentOutOfRangeException: ControlCollection
+does not have that many controls
+Parameter name: index
+-1
+  at System.Windows.Forms.Control+ControlCollection.get_Item (Int32 index)
+[0x00000] 
+  at System.Windows.Forms.TabControl.GetTab (Int32 index) [0x00000] 
+  at System.Windows.Forms.TabControl.GetTabRect (Int32 index) [0x00000] 
+  at System.Windows.Forms.TabControl.OnGotFocusInternal (System.EventArgs
+e) [0x00000] 
+  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message m)
+[0x00000] 
+  at System.Windows.Forms.TabControl.WndProc (System.Windows.Forms.Message
+m) [0x00000] 
+  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
+(System.Windows.Forms.Message m) [0x00000] 
+  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg,
+IntPtr wParam, IntPtr lParam) [0x00000] 
+  at (wrapper native-to-managed) System.Windows.Forms.NativeWindow:WndProc
+(intptr,System.Windows.Forms.Msg,intptr,intptr)
+  at <0x00000> <unknown method>
+  at (wrapper managed-to-native)
+System.Windows.Forms.XplatUIWin32:Win32SetFocus (intptr)
+  at System.Windows.Forms.XplatUIWin32.SetFocus (IntPtr hwnd) [0x00000] 
+  at System.Windows.Forms.XplatUI.SetFocus (IntPtr handle) [0x00000] 
+  at System.Windows.Forms.ContainerControl.SendControlFocus
+(System.Windows.Forms.Control c) [0x00000] 
+  at System.Windows.Forms.ContainerControl.set_ActiveControl
+(System.Windows.Forms.Control value) [0x00000] 
+  at System.Windows.Forms.Control.Select (System.Windows.Forms.Control
+control) [0x00000] 
+  at System.Windows.Forms.Form.SelectActiveControl () [0x00000] 
+  at System.Windows.Forms.Form.OnActivated (System.EventArgs e) [0x00000] 
+  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message m)
+[0x00000] 
+  at System.Windows.Forms.Control+ControlNativeWindow.WndProc
+(System.Windows.Forms.Message m) [0x00000] 
+  at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg,
+IntPtr wParam, IntPtr lParam) [0x00000] 
+  at (wrapper native-to-managed) System.Windows.Forms.NativeWindow:WndProc
+(intptr,System.Windows.Forms.Msg,intptr,intptr)
+  at <0x00000> <unknown method>
+  at (wrapper managed-to-native)
+System.Windows.Forms.XplatUIWin32:Win32SetFocus (intptr)
+  at System.Windows.Forms.XplatUIWin32.SetFocus (IntPtr hwnd) [0x00000] 
+  at System.Windows.Forms.XplatUI.SetFocus (IntPtr handle) [0x00000] 
+  at System.Windows.Forms.ContainerControl.SendControlFocus
+(System.Windows.Forms.Control c) [0x00000] 
+  at System.Windows.Forms.ContainerControl.set_ActiveControl
+(System.Windows.Forms.Control value) [0x00000] 
+  at System.Windows.Forms.Control.Select (Boolean directed, Boolean
+forward) [0x00000] 
+  at System.Windows.Forms.Control.SelectNextControl
+(System.Windows.Forms.Control ctl, Boolean forward, Boolean tabStopOnly,
+Boolean nested, Boolean wrap) [0x00000] 
+  at System.Windows.Forms.Form.SelectActiveControl () [0x00000] 
+  at System.Windows.Forms.Form.OnCreateControl () [0x00000] 
+  at System.Windows.Forms.Control.CreateControl () [0x00000] 
+  at System.Windows.Forms.Control.SetVisibleCore (Boolean value) [0x00000] 
+  at System.Windows.Forms.Form.SetVisibleCore (Boolean value) [0x00000] 
+  at System.Windows.Forms.Control.set_Visible (Boolean value) [0x00000] 
+  at (wrapper remoting-invoke-with-check)
+System.Windows.Forms.Control:set_Visible (bool)
+  at System.Windows.Forms.Application.RunLoop (Boolean Modal,
+System.Windows.Forms.ApplicationContext context) [0x00000] 
+  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form
+mainForm) [0x00000] 
+  at MonoTest32.Form1.Main () [0x00000]


More information about the mono-bugs mailing list