473,321 Members | 1,708 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

WebBrowser Control

Hi All,

Given a collection of links, how can I send them to a WebBrowser Control so
that I can manipulate it's document? Ok, that's way too simplified of a
question. I know how to send a link to a WebBrowser:

/////
WebBroweser1.Navigate(Link)
/////

but I can figure out how to send several links in succession. In my test,
I've got a simple collection that contains 5 strings. Pressing a command
button performs:

/////
For Each s As String In links
WebBrowser1.Navigate(s)
Next
/////

and in the WebBrowser1's DocumentCompleted Event is:

/////
Dim doc As HtmlDocument = WebBrowser1.Document
Debug.Print(doc.Url.ToString)
/////

However, the only Url string ever printed to the immediate window is the
last one in the collection, and all the WebBrowser1 window ever shows is
that last webpage.

I realize this probably has something to do with synchronization, but I'm
not sure how to resolve this.

Thanks,
Lance
Sep 8 '06 #1
2 1805
Hello Lance" chuckyboy81070-at-onehotpotatoimeanhotmail.com,

..Navigate() is an asynch method. The navigation and remdering is passed
off to the web browser control, which uses a separate thread(s) to do the
work.. and immediately returns from the .Navigate method.

The correct method for navigating multiple URLs in succession.. which you
should have guessed from your investigations had you just applied yourself..
is to navigate to each successive URL from within the DocumentCompleted event.

-Boo
Hi All,

Given a collection of links, how can I send them to a WebBrowser
Control so that I can manipulate it's document? Ok, that's way too
simplified of a question. I know how to send a link to a WebBrowser:

/////
WebBroweser1.Navigate(Link)
/////
but I can figure out how to send several links in succession. In my
test, I've got a simple collection that contains 5 strings. Pressing
a command button performs:

/////
For Each s As String In links
WebBrowser1.Navigate(s)
Next
/////
and in the WebBrowser1's DocumentCompleted Event is:

/////
Dim doc As HtmlDocument = WebBrowser1.Document
Debug.Print(doc.Url.ToString)
/////
However, the only Url string ever printed to the immediate window is
the last one in the collection, and all the WebBrowser1 window ever
shows is that last webpage.

I realize this probably has something to do with synchronization, but
I'm not sure how to resolve this.

Thanks,
Lance


Sep 9 '06 #2
Thanks Boo. You're right, I would have eventually figured that out. I
tried for several hours and just thought I'd drop a note to the group before
the weekend.

Thanks again,
Lance

"GhostInAK" <gh*******@gmail.comwrote in message
news:be**************************@news.microsoft.c om...
Hello Lance" chuckyboy81070-at-onehotpotatoimeanhotmail.com,

.Navigate() is an asynch method. The navigation and remdering is passed
off to the web browser control, which uses a separate thread(s) to do the
work.. and immediately returns from the .Navigate method.

The correct method for navigating multiple URLs in succession.. which you
should have guessed from your investigations had you just applied
yourself.. is to navigate to each successive URL from within the
DocumentCompleted event.

-Boo
>Hi All,

Given a collection of links, how can I send them to a WebBrowser
Control so that I can manipulate it's document? Ok, that's way too
simplified of a question. I know how to send a link to a WebBrowser:

/////
WebBroweser1.Navigate(Link)
/////
but I can figure out how to send several links in succession. In my
test, I've got a simple collection that contains 5 strings. Pressing
a command button performs:

/////
For Each s As String In links
WebBrowser1.Navigate(s)
Next
/////
and in the WebBrowser1's DocumentCompleted Event is:

/////
Dim doc As HtmlDocument = WebBrowser1.Document
Debug.Print(doc.Url.ToString)
/////
However, the only Url string ever printed to the immediate window is
the last one in the collection, and all the WebBrowser1 window ever
shows is that last webpage.

I realize this probably has something to do with synchronization, but
I'm not sure how to resolve this.

Thanks,
Lance


Sep 9 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Noozer | last post by:
I've got a WebBrowser control (AxBrowse - VCMAXB.DLL) and I'm having a few difficulties with it. Just looking for a few pointers, not whole solutions here. I've tried looking at the MSDN help files...
4
by: Randy | last post by:
Hi, ok, I found a way to connect to a running instance of an (external) Internet Explorer and access - for example - the html source. That works fine! But now I have running application with...
9
by: ASP .NET Newbie | last post by:
How can I run a WebBrowser control using ASP.NET/VB.NET? I know I can use the WebClient to get the page data, but I need to be able to use the WebBrowser (AxWebBrowser)? Thanks, Chad
0
by: Jim Hubbard | last post by:
How would I implement the IDispatch interface to handle the following in VB.Net <BEGIN> Controlling Download and Execution The WebBrowser Control gives you control over what it downloads,...
12
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but...
8
by: Prosperz | last post by:
Hi, I would like to make thumbnails of web page by capture content of a WebBrowser. By example, capture http://www.google.com. I used WebBrowser control with Framework 2.0. I try this : ...
1
by: L. Chernov | last post by:
Hello, I am trying to work with .Net 2005 WebBrowser object, and put it on a "Windows control library" (embedded in a user control class) and then I am executing it from an ASP.Net webform(with...
11
by: Anil Gupte | last post by:
....and how do I insert one into my form? I used in VB 6.0 last, but cannot figure out where it is in .Net Thanx, -- Anil Gupte www.keeninc.net www.icinema.com
4
by: Steve Richter | last post by:
I would like to build an HTML stream as a string and have the WebBrowser control render that HTML. Then on PostBack, or whatever it is called, I would like my code to be the one that receives what...
5
by: kimiraikkonen | last post by:
Hi, I couldn't find a necessary class which shows when mouse hovers on a link in Webbrowser control. Think of there's a status bar(text), when mouse comes on a link, the URL must be shown in...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.