|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
WebBrowser ControlGiven 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 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 Show quoteHide quote > 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 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 Show quoteHide quote "GhostInAK" <ghosti***@gmail.com> wrote in message news:be1391bf175808c8a1799764d8d6@news.microsoft.com... > 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 > > >
Hiding a Property
Writing a brute force program using SendKeys.Send self-extracting files in .net Extending an Abstract class that uses a Generic Parameter Get all forms contained in another project Check for Updates Try to delete a worksheet in Excel File Not Accessed Restricting the resizing of forms Adding row to data table in .net 2.0 |
|||||||||||||||||||||||