DataColChanged代码哪里错了? Dim i As Integer If e.DataCol.Name = "收入" OrElse e.DataCol.Name = "支出" Then For Each dr As DataRow In e.DataTable.DataRows dr(0)("余额") = dr(0)("收入")-dr(0)("支出") For i = 1 to e.DataTable.DataRows.Count-1 dr(i)("余额") = dr(i-1)("余额")+dr(i)("收入")-dr(i)("支出") Next Next End If