how to update url in the textbox when switching tabs In vb.net
I have a tabbed web browser its working fine , but i have a little problem and that is if i open a new tab is ok but if i go back to previous tab the urltextbox it have the url in the tab last opened tab.
so i am asking you for help if you have the solution
You could use the SelectedIndexChanged event of the TabControl to then find the the WebBrowser control on that tab page and read its Url property. Something like:
Private Sub TabControl1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles TabControl1.SelectedIndexChanged
'Grab the Web Browser control on this tab and read its URL property
'NOTE, only expect to get one browser control.
For Each wb As WebBrowser In TabControl1.SelectedTab.Controls.OfType(Of WebBrowser)()
urlTextBox.Text = wb.Url.ToString
The above does assume that you would only have one WebBrowser control on each TabPage. There are other ways of finding the WebBrowser control if this is not the case.
I'm discovering that my Excel spreadsheets that are being created by a VB.net app I've written isn't completely closing them as they should be. I'm struggling to understand why and how to fix this. Here is the code for the portion of the app that creates the workbook, ...