.....................咳咳....关于楼主这个问题....你新建个类模块,名字假设cWBEvent吧....然后在类模块里这样声明:dim withevents tmpWeb As WebBrowser再来个接口供外部设置:public sub SetWB(byref objWB as WebBrowser) set tmpweb=objwb end sub再在主窗口里面声明这个类的对象数组......如:dim objWBEvent() as cWBEvent 这样的话,利用我上面的那个代码,就可以接收当前所有页面的事件了.... redim objWBEvent(WebCount.Count-1) For tmpI = 0 To WebCount.Count - 1 Set objWBEvent(I) = WebCount.Item(tmpI)
Debug.Print tmpWeb.LocationURL Debug.Print tmpWeb.LocationName Next
set tmpweb=objwb
end sub再在主窗口里面声明这个类的对象数组......如:dim objWBEvent() as cWBEvent 这样的话,利用我上面的那个代码,就可以接收当前所有页面的事件了.... redim objWBEvent(WebCount.Count-1)
For tmpI = 0 To WebCount.Count - 1
Set objWBEvent(I) = WebCount.Item(tmpI)
Debug.Print tmpWeb.LocationURL
Debug.Print tmpWeb.LocationName
Next