I started to code a program in VB6 only because I knew the language well and how to work with it. I unfortunately ran into some snags since it's an older program, and now I'm learning the more recent version of it (2010) but have a question:
How do I create more instances of WebBrowser in this latest version? This is my code from VB6 to help you get an idea of what I mean:
If Not AdBrowser(URLs.ListIndex + 1) Then
'For i = 1 To URLs.ListCount - 1
Load AdBrowser(URLs.ListIndex + 1)
'Next i
AdBrowser(URLs.ListIndex + 1).Left = 120
AdBrowser(URLs.ListIndex + 1).Top = 240
AdBrowser(URLs.ListIndex + 1).Height = 7695
AdBrowser(URLs.ListIndex + 1).Width = 15975
End If
Basically what the code is doing is when someone clicks on the list box, it creates a new instance of AdBrowser and keeps the Array # the same index as the list index. I need similar code that will do the same thing in the latest VB..
I know you can't do the same thing as before and I've looked it up on Google with a couple different variations and still nothing. I've found stuff related to creating control arrays which is basically what I'm doing here, but nothing that would work with WebBrowser control.
New question!
Now I'm having troubles finding a way to check if the browser is already loaded, this is my code that isn't working but has the right idea:
For i = 0 To BrowserArray.Count
BrowserArray(i).Visible = False
Next
If Not BrowserArray(URLs.SelectedIndex) Then
Else
BrowserArray = New AdBrowserArray(Me)
BrowserArray.AddNewBrowser(MainFrame)
BrowserArray(URLs.SelectedIndex).Navigate("http://google.com")
End If