0

我可以毫无问题地将控件从我的工具箱拖放到我的表单上,但是如果我将控件拖放到表单周围,我会收到以下错误消息:

"The control System.Windows.Forms.DataGridView has thrown an unhandled exception in the designer and has been disabled.

Exception:
Value cannot be null.
Parameter name: child"

它会在控件上绘制错误图像。此错误仅发生在我的一个表单上,并且在我调试时一切都以应有的方式运行。这不是一个大问题,但是当我每次在这个特定表单上移动任何控件时,我都会收到这个错误,并且它会在控件上绘制一个错误图像,这会变得相当烦人。这是控件上显示的错误图像的消息:

"System.ArgumentNullException: Value cannot be null.
Parameter name: child
at System.Windows.Forms.Control.ControlCollection.SetChildIndexInternal(Control child, Int32 newIndex)
at System.Windows.Forms.Control.ControlCollection.SetChildIndex(Control child, Int32 newIndex)
at Microsoft.VisualBasic.PowerPacks.Design.EventManager.Reparent(ShapeContainer shCon)
at Microsoft.VisualBasic.PowersPacks.Design.EventManager.OnEndDrag(Object sender, BehaviorDragDropEventArgs e)
at System.Windows.Forms.Design.Behavior.BehaviorService.OnEndDrag(BehaviorDragDropEventArgs e)
at System.Windows.Forms.Design.Behavior.BehaviorService.DoDragDrop(DropSourceBehavior dropSourceBehavior)
at System.Windows.Forms.Design.ControlDesigner.OnMouseDragMove(Int32 x, Int32 y)
at System.Windows.Forms.Design.ControlDesigner.WndProc(Message& m)
at System.Windows.Forms.Design.ControlDesigner.DesignerWindowTarget.OnMessage(Message& m)"

谢谢,任何帮助将不胜感激。

4

0 回答 0