473,396 Members | 1,924 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,396 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 1807
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.