当我在我正在工作的“Visual Studio 2011 Ultimate 12”中按开始时,它说:
“InvalidOperationException 未处理,调试器捕获了异常,用户设置表明应该发生中断。此线程停止,调用堆栈上只有外部代码帧。外部代码帧通常来自框架代码,但也可以包括其他在目标进程中加载的优化模块。"`
我的代码:
Public Class Form1
Private matrix As Integer(,) = PopulateMatrix()
Private Sub ClickMouse(sender As Object, e As DataGridViewCellMouseEventArgs) Handles DataGridView.CellMouseClick
MsgBox(e.Clicks & e.ColumnIndex & e.RowIndex)
matrix(e.ColumnIndex, e.RowIndex) = 0
Matrixtomatrixdef(matrix)
End Sub
Private Function PopulateMatrix() As Integer(,)
Dim matrix(10, 10) As Integer
For rown = 0 To 9
For columnn = 0 To 9
matrix(columnn, rown) = 1
Next
Next
Return matrix
End Function
Private Sub Matrixtomatrixdef(matrix As Integer(,))
Dim Matrixdef(10, 10) As Integer
For rown = 0 To 9
For columnn = 0 To 9
Matrixdef(columnn, rown) = matrix(columnn, rown)
Debug.Write(Matrixdef(columnn, rown).ToString & " ")
Next
Debug.WriteLine("")
Next
End Sub
End Class