Dim dt As DataTable = DataTables("医生排班表") If dt.HasChanges Then Dim Result As DialogResult Result = MessageBox.Show("排班表已经修改,是否需要保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If Result = DialogResult.Yes Then dt.Save Else dt.RejectChanges End If Else Forms("排班窗口").Close End If