这段代码执行后总是显示这个问题,我测试老是出现“未将对象引用设置到对象的实例。”问题,请老师帮忙修改:
If CurrentTable IsNot Nothing Then
Dim dr As Row = CurrentTable.Current
If CurrentTable.Current.DataRow.RowState <> DataRowState.Unchanged Then
Dim Result As DialogResult
Result = MessageBox.Show("数据修改后未保存,是否保存或撤销操作?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
dr.save()
dr.Locked=True
e.Form.close()
Else
Syscmd.Edit.Undo()
End If
End If
If dr.Locked = False Then
dr.Locked = True
End If
End If
If CurrentTable IsNot Nothing Then
Dim dr As Row = CurrentTable.Current
If dr IsNot Nothing Then
If CurrentTable.Current.DataRow.RowState <> DataRowState.Unchanged Then
Dim Result As DialogResult
Result = MessageBox.Show("数据修改后未保存,是否保存或撤销操作?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
dr.save()
dr.Locked = True
Else
Syscmd.Edit.Undo()
End If
End If
If dr.Locked = False Then
dr.Locked = True
End If
End If
End If
[此贴子已经被作者于2024/5/26 19:48:04编辑过]