
webbrowser control - how to stop navigation
Trap the BeforeNavigate2 event, set the Cancel parameter to true.
Option Explicit
Dim flag As Boolean
Private Sub Command1_Click()
flag = True
End Sub
Private Sub Form_Load()
flag = False
WebBrowser1.Navigate "http://www.msn.com"
End Sub
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As
Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant,
Headers As Variant, Cancel As Boolean)
Cancel = flag
'MsgBox URL
End Sub
Hope it helps.
Sincerely,
Alick Ye, MCSD
Product Support Services
Microsoft Corporation
Get Secure! - <www.microsoft.com/security>
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Newsgroups: microsoft.public.vb.controls.internet
| Subject: webbrowser control - how to stop navigation
| Date: 22 Jan 2003 04:05:10 -0800
| NNTP-Posting-Date: 22 Jan 2003 12:05:10 GMT
| X-Tomcat-NG: microsoft.public.vb.controls.internet
|
| Hi,
|
| I am new to vb, in my application I am using VB Webbrowser control.
| After getting the new pages in Webbrowser, I don't want navigate
| through the links which were in the webbrowser.
|
| Any body knows how to prevent the navigation through the links which
| were in VB Webbrowser.
|
| Thanks in advance,
|
| kvs
|