这个问题好像要老六来解决。
现在只好先判断一下吧。
Dim tab As WinForm.TabControl = e.Form.Controls("TabControl1")
If e.Form.ExistControl("Button1")
Dim qrxg As WinForm.Button = e.Form.Controls("Button1")
If tab.SelectedIndex = 1 Then
If qrxg.Visible = True Then
MessageBox.Show("请先确认修改后再离开界面!","错误提示", MessageBoxButtons.OK ,MessageBoxIcon.Information)
e.Cancel = True
End If
End If
End If