Dim Result As DialogResult If Tables("销售单").Current.DataRow.RowState = DataRowState.Unchanged e.Form.Close Else Result = MessageBox.Show("该条记录没有保存,是否放弃?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.no Then Return End If Tables("销售单").Current.Reject() e.Form.Close