I've got a tab control that I dynamically create tabs for each record in a dataset. In each tab, a web browser control is dynamically created as well. It looks like this:
For Each Row As DataRow In DataSet.Tables("Pages").Rows
TabControl1.TabPages.Add(Row.Item("tab_title"), Row.Item("tab_title"))
Dim WebBrowser As New WebBrowser
TabControl1.TabPages(Row.Item("tab_title").ToString()).Controls.Add(WebBrowser)
WebBrowser.Dock = DockStyle.Fill
WebBrowser.Navigate(Row.Item("url").ToString())
Next
It works well. Each tab is created, with its browser, and then the page is loaded. No problem there. Now suppose I wanted to create a "refresh" button or a "back / forward" button within each tab to navigate the web browser, how would I do this? As far as I know, each browser is named "WebBrowser" and the Visual Studio GUI doesn't even recognize WebBrowser outsize of that sub routine I pasted above.
How do I handle this? Thanks in advance for any advice.
For Each Row As DataRow In DataSet.Tables("Pages").Rows
TabControl1.TabPages.Add(Row.Item("tab_title"), Row.Item("tab_title"))
Dim WebBrowser As New WebBrowser
TabControl1.TabPages(Row.Item("tab_title").ToString()).Controls.Add(WebBrowser)
WebBrowser.Dock = DockStyle.Fill
WebBrowser.Navigate(Row.Item("url").ToString())
Next
It works well. Each tab is created, with its browser, and then the page is loaded. No problem there. Now suppose I wanted to create a "refresh" button or a "back / forward" button within each tab to navigate the web browser, how would I do this? As far as I know, each browser is named "WebBrowser" and the Visual Studio GUI doesn't even recognize WebBrowser outsize of that sub routine I pasted above.
How do I handle this? Thanks in advance for any advice.