Having trouble addressing with objects created at run-time

32 Views Asked by At

I am quite new to programming and I was attempting to make a small browser in Win-forms. I wanted to expand on the code I got from a tutorial which is used to create a new tab:

WebBrowser wb = new WebBrowser();
public browsertab() {
    wb.SetBounds(0,0, helper.formWidth - 30, helper.formHeight - 30);
    wb.Url = new Uri("http://www.google.com");
    this.Controls.Add(wb);
}

Now this code works fine, except i can't find a way to address the browser in the currently open tab since the name doesn't exist on startup. I want the searchbar to search in the currently open tab but i can't seem to do it. Can anyone help me with naming and accesing these instances of the browser?

Thanks to anyone who can help!

0

There are 0 best solutions below