Each tab/browser should have an array of string address's that the user can cycle through. Different tabs have different addresses to cycle through with left and right arrows.
I can do all this manually with one tab that uses an arraylist of addresses to navigate to but I cant do it with more than one. SO far i am able to add new tabs, and even add a browser to them but cannot navigate the browser to the address since I cannot access the browser name of the new tab. I also do not know how to assign an arraylist of string addresses dynamically. I have read in address from a text file I just dont know what to do with the arraylist.
I want to be able to make the browser of the currently selected tab navigate to the first address on the arraylist assigned to that tab. If you can point out how to do this, not even codewise but pesudo code would be helpful as I can not figure it out after spending a week trying different ways
Some snippets:
Expand|Select|Wrap|Line Numbers
- tabControl1.SelectedTab
- Manual way of going forward and backwards on a tab:
- private void Next()
- {
- if (current < list.Count-1)
- {
- current++;
- String x = (String)list[current];
- webBrowser1.Navigate(x);
- addressField.Text = x;
- }
- else
- {
- Console.WriteLine("AT THE END");
- }
- Enabler();
- }
- private void Previous()
- {
- if (current > 0)
- {
- current--;
- String x = (String)list[current];
- webBrowser1.Navigate(x);
- addressField.Text = x;
- }
- else
- {
- Console.WriteLine("AT THE START");
- }
- Enabler();
- }
- private void Enabler()
- {
- String x = (String)list[current];
- if (current == list.Count - 1)
- {
- toolStripButton2.Enabled = false;
- }
- else
- {
- toolStripButton2.Enabled = true;
- }
- if (current == 0)
- {
- toolStripButton1.Enabled = false;
- }
- else
- {
- toolStripButton1.Enabled = true;
- }
- UpdateSeperator();
- }
- private void UpdateSeperator()
- {
- int g = list.Count;
- SeperateButtons.Text = (current+1) + "/" + g;
- }
- Adding a tab:
- private void OpenTab()
- {
- bookmarks.Add("http://www.beer.com");
- bookmarks.Add("http://www.sky.com");
- bookmarks.Add("http://www.taffatech.com");
- String title = "List " + (tabControl1.TabCount + 1).ToString();
- TabPage addedTabPage = new TabPage(title); //create the new tab
- tabControl1.TabPages.Add(addedTabPage); //add the tab to the TabControl
- WebBrowser addedWebBrowser = new WebBrowser();
- addedWebBrowser.Parent = addedTabPage; //add the new webBrowser to the new tab
- addedWebBrowser.Dock = DockStyle.Fill;
- String add = (String) bookmarks[bookmarks.Count];
- addedWebBrowser.Navigate(add);
- }