老师,我在窗口的beforeclose事件中有如下代码:
For Each dr As DataRow In DataTables(e.Form.name & "_table1").dataRows
If dr.RowState <> DataRowstate.unchanged Then
Dim Result As DialogResult
Result = MessageBox.Show("上表中有未保存的行 , 请确认是否需要处理 ?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
e.Cancel = True
Return
End If
End If
Next
执行上述代码,点击 yes 后,窗口依然关闭,不知道什么原因?请指点。谢谢!