我已经开发了一个vb.net应用程序,该应用程序运行良好,但是当我关闭特定表单时,它给我mybase.dispose(dispose)上的designer.vb文件错误
,错误为“ System.ArgumentOutOfRangeException:'索引超出范围。必须为非负数并且小于集合的大小。 参数名称:index'“
现在,我通过注释代码来减少原因,并在将其添加到datagridview的行中找到其原因。如果我对这一行发表评论,那么它将关闭。
我不知道为什么会出错,需要任何帮助。
谢谢。
更新-堆栈跟踪:
System.ArgumentOutOfRangeException occurred
HResult=0x80131502
Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source=<Cannot evaluate the exception source>
StackTrace:
at System.Collections.ArrayList.get_Item(Int32 index)
at System.Windows.Forms.DataGridViewColumnCollection.get_Item(Int32 index)
at System.Windows.Forms.DataGridView.FlushDisplayedChanged()
at System.Windows.Forms.DataGridView.PerformLayoutPrivate(Boolean useRowShortcut, Boolean computeVisibleRows, Boolean invalidInAdjustFillingColumns, Boolean repositionEditingControl)
at System.Windows.Forms.DataGridView.OnColumnCollectionChanged_PreNotification(CollectionChangeEventArgs ccea)
at System.Windows.Forms.DataGridViewColumnCollection.Clear()
at System.Windows.Forms.DataGridView.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at DevComponents.DotNetBar.PanelControl.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.Form.Dispose(Boolean disposing)
at VURSA.Measurement_Screen.Dispose(Boolean disposing) in C:\Users\patil\OneDrive\Documents\Visual Studio 2017\Projects\VURSA\VURSA\Measurement_Screen.Designer.vb:line 13
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)