If e.Form.BaseForm.WindowState = 2 Then
msgbox("最大化")
elseIf e.Form.BaseForm.WindowState = 1 Then
msgbox("最小化")
End If