Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
VB
WebBrowser1.Navigate("http://www.google.com.br")
       WebBrowser2.Navigate("http://www.google.com.br")
       WebBrowser3.Navigate("http://www.google.com.br")
       WebBrowser4.Navigate("http://www.google.com.br")
       WebBrowser5.Navigate("http://www.google.com.br")
       WebBrowser6.Navigate("http://www.google.com.br")
       WebBrowser7.Navigate("http://www.google.com.br")
       WebBrowser8.Navigate("http://www.google.com.br")
       WebBrowser9.Navigate("http://www.google.com.br")
       WebBrowser10.Navigate("http://www.google.com.br")
       WebBrowser11.Navigate("http://www.google.com.br")
       WebBrowser12.Navigate("http://www.google.com.br")
       WebBrowser13.Navigate("http://www.google.com.br")
       WebBrowser14.Navigate("http://www.google.com.br")
       WebBrowser15.Navigate("http://www.google.com.br")
Posted
Comments
SoMad 21-Jan-13 22:37pm    
You must have made a mistake. Please recheck the question you have posted.

Soren Madsen
Bruno C Soares 21-Jan-13 22:44pm    
'm sorry but I do not speak English fluently
But I would like to reduce size of code
Sergey Alexandrovich Kryukov 21-Jan-13 22:59pm    
Just joking? Not funny, my 1.
—SA
Bruno C Soares 21-Jan-13 23:02pm    
I'm not...
SoMad 21-Jan-13 23:10pm    
The problem is that the question you have posted is just 15 identical lines. Yes, I can see that they are individual objects, but you need to show more of your code and maybe explain why they all navigate to the same address.

Soren Madsen

I Don Know VB.net So Using C sharp

Since WebBrowser1,2,3....are objects u can create a list of WebBrowser class.
like

if class is in this structure

Public Class WebBrowser
{

public String Url{get; set;}

public Void Navigate(String path)
{
Url=path;
}
}

you created object of this class and called method like this

WebBrowser WebBrowser1=new WebBrowse();
WebBrowser WebBrowser2=new WebBrowse();
.
.
.
VB
WebBrowser1.Navigate("http://www.google.com.br")
WebBrowser2.Navigate("http://www.google.com.br")

.
.
.
instead of this create list like this

List<webbrowser> webBrowserList=new List<webbrowser>();
for(i=0;i<=10;i++)
{
WebBrowser webBrowserObj=new WebBrowser();
webBrowserObj.Navigate("http://www.google.com.br[^]");
webBrowserList.Add(webBrowserObj);
}
 
Share this answer
 
v3
If I Understand Correctly, Then It's my Solution...

You may Use For Each Loop, If all WebBrowser Controls Present in Same Container (Form, Panel, Tab Strip, Group Control or More Similar Control)
VB
For Each Obj As Object In Form1.Controls
    If TypeOf(Obj) Is WebBrowser Then Obj.Navigate("www.google.com.br")
Next

Accept This Solution if it Help You in anyway...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900