Dim e =args(0)
Dim tbname As String="fa0101_fa0101"
Dim Result As DialogResult
If Tables(tbname).Current IsNot Nothing Then
If Tables(tbname).Current.DataRow.RowState<>DataRowState.Unchanged Then
'Result = MessageBox.Show("是否退出?" & vbcrlf & "【是】将退出保存,【否】将退出,【取消】将返回继续编辑?","提示",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Information)
Result = MessageBox.Show(e.Form.baseform,"是否退出?" & vbcrlf & "【是】将退出保存,【否】将退出,【取消】将返回继续编辑?","提示",MessageBoxButtons.YesNoCancel,MessageBoxIcon.Information)
If Result = DialogResult.Yes Then
If Tables(tbname).Current("id")="" Then
e.Cancel=True
End If
End If
Else If Result = DialogResult.Cancel Then
e.Cancel=True ‘这块没有拦截成功’’
'e.Form.baseform.BringToFront
Else If Result = DialogResult.No Then
'e.Form.baseform.BringToFront
Tables(tbname).AllowEdit=True
Tables(tbname).Current.Reject‘这块没有撤销成功’
Tables(tbname).AllowEdit=False
End If
Else
PopMessage("未发生变化不需要保存!","提示",PopIconEnum.Infomation,2)
End If