OnPageWindowActivate 事件

       

在当前窗口中的网页获得焦点时发生。

Private Sub expression_OnPageWindowActivate(ByVal pPage As PageWindow)

expression  在类模块中以事件方式声明的 Application 类型对象的变量名称。

pPage  包含视图的 PageWindowEx 对象。

示例

下列示例在每次网页窗口获得焦点时提示用户刷新网页。

Private Sub objApp_OnPageWindowActivate(ByVal pPage As PageWindow)
'Occurs when current page in the main window obtains focus.
'Prompts the user to refresh the current page.

     Dim strAns As String
     strAns = MsgBox("Do you want to refresh the page " & pPage.Caption & "?", _
                      vbYesNo)
     If strAns = vbYes Then
         pPage.Refresh
     End If

End Sub