是编写beforeclose事件么?
Dim Result As DialogResultResult = MessageBox.Show("关闭窗口前要保存数据吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)If Result = DialogResult.Yes Then Dim btn As WinForm.Button = e.Form.Controls("ButtonAdd") btn.PerformClick()End If