|
-
Jul 15th, 2003, 10:43 AM
#1
Thread Starter
Lively Member
-
Jul 15th, 2003, 01:14 PM
#2
beforenavigate2 has a known problem ( not working lol ) but here's a fix i just slapped together for you :
VB Code:
Private WithEvents doc As SHDocVw.DWebBrowserEvents_Event
'/// handle all browser events through doc now not brWeb.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim b As Object = brWeb.Application
doc = DirectCast(b, SHDocVw.WebBrowser_V1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
brWeb.Navigate("http://google.com")
End Sub
Private Sub doc_BeforeNavigate(ByVal URL As String, ByVal Flags As Integer, ByVal TargetFrameName As String, ByRef PostData As Object, ByVal Headers As String, ByRef Cancel As Boolean) Handles doc.BeforeNavigate
MessageBox.Show(URL)
End Sub
hope it helps.
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 16th, 2003, 06:05 AM
#3
Thread Starter
Lively Member
Cheers dynamic_sysop, that's sure to help
One other thing though the doc doesn't have a documentComplete
the webbrowser does.
Is it ok to use the webbrowsers documentComplete?
If not does the downloadComplete do the same job, cos doc has one of them ?
I need the docComplete so that I can load a webpages HTML source once the (visual) page has totally loaded.
Cheers for your help dynamic_sysop
-
Jul 16th, 2003, 06:07 AM
#4
use the doc's document_Complete
all the events you need are covered by doc
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 16th, 2003, 07:02 AM
#5
Thread Starter
Lively Member
-
Jul 16th, 2003, 07:13 AM
#6
VB Code:
Private WithEvents doc As SHDocVw.DWebBrowserEvents_Event
'/// doc will handle all the events for brWeb now...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim b As Object = brWeb.Application
doc = DirectCast(b, SHDocVw.WebBrowser_V1) '///set doc as the active handler for brWeb's events.
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
brWeb.Navigate("http://google.com") '///lets navigate to a website.
End Sub
Private Sub doc_BeforeNavigate(ByVal URL As String, ByVal Flags As Integer, ByVal TargetFrameName As String, ByRef PostData As Object, ByVal Headers As String, ByRef Cancel As Boolean) Handles doc.BeforeNavigate
MessageBox.Show(URL) '/// check that before navigate now works.
End Sub
Private Sub doc_StatusTextChange(ByVal [Text] As String) Handles doc.StatusTextChange
Label1.Text = Text '///show the status text in a label.
End Sub
Private Sub doc_TitleChange(ByVal [Text] As String) Handles doc.TitleChange
MyBase.Text = Text '/// set the form's caption to the current url
End Sub
Private Sub doc_DownloadComplete() Handles doc.DownloadComplete
MessageBox.Show(brWeb.LocationURL & " is now complete!")
End Sub
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Jul 16th, 2003, 09:10 AM
#7
Thread Starter
Lively Member
You are most helpful
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|