|
-
Jun 23rd, 2004, 01:17 PM
#1
Thread Starter
New Member
Array Problems
I have 2 buttons, 1 TabControl.
1 of the buttons makes a Tab in the TabControl and a webbrowser in the tabpage but when i hit the other button which is to make the Webrowser control goto your ome page it doesn't work.
Here is my code
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim A As New TabPage
Dim WB As New AxSHDocVw.AxWebBrowser
Tabs.TabPages.Add(A)
A.Controls.Add(WB)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim A As New TabPage
Dim axwebbrowser1 As AxSHDocVw.AxWebBrowser
axwebbrowser1.GoHome()
End Sub
But it doesn't work.
I am new to creating the array list like this any suggestions on how to make it better/work is great 
drgnstrmace
-
Jun 23rd, 2004, 01:30 PM
#2
Frenzied Member
You didn't New it in the second one, so there is no instance. Where is there an Array in this
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
-
Jun 23rd, 2004, 01:33 PM
#3
Thread Starter
New Member
Cause in the first Sets of Code when I click the 1st button mutible Times it makes mutible Tabs and WebBrowser Controls but it isn't allowing me to take and set the instance of 1 WebBrowser Control so that it will navigate and the others won't..
-
Jun 23rd, 2004, 01:59 PM
#4
Frenzied Member
In the first one, you are adding tabpages to the tabpage collection. While similiar, this is different from an array. I don't understand what you want the second one to do? You are creating a Tab Page, but not doing anything with it. And you are creating a reference to a webbrowser, but you are not instantiating it or assigning it to an existing webbrowser. Then you are tryingto make a call from a reference that doesn't point to anything, so I would guess at that point it tosses you an error.
Sean
Some days when I think about the next 30 years or so of my life I am going to spend writing code, I happily contemplate stepping off a curb in front of a fast moving bus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|