当用户调整当前 Explorer 或 Inspector 大小时发生。该事件在开始后可以取消。如果取消该事件,将不调整窗口大小。
Private Sub expression_BeforeSize(Cancel As Boolean)
expression 该表达式返回“应用于”列表中的一个对象,该对象在类模块中以事件形式声明。
Cancel 必选,Boolean 类型。当事件发生时为 False。如果事件过程将此参数设为 True,将不完成该操作,并且不调整浏览器或检查器的大小。
以下示例在调整检查器大小前向用户弹出一条警告消息。如果用户单击“是”,就可以调整检查器的大小。
Private Sub expression_BeforeSize(Cancel As Boolean)
'Prompts the user before resizing the window
Dim lngAns As Long
lngAns = MsgBox("Are you sure you want to resize the current window?", vbYesNo)
If lngAns = vbYes Then
Cancel = False
Else
Cancel = True
End If
End Sub