动态添加控件如何设置这个控件
Dim mytabpage As New TabPage()mytabpage.Name = "tabpage" & (Me.TabControl1.TabPages.Count + 1)
mytabpage.Text = "tabpage" & (Me.TabControl1.TabPages.Count + 1)
Me.TabControl1.TabPages.Add(mytabpage)
mytabpage.Show()
Dim wb As New WebBrowser()
wb.Name = "webtabpage" & (Me.TabControl1.TabPages.Count + 1)
wcons(Me.TabControl1.TabPages.Count + 1) = wb
wb.Parent = mytabpage
wb.Anchor = AnchorStyles.Top
wb.Anchor = AnchorStyles.Left
wb.Dock = DockStyle.Fill
wb.Show()
wb.Select()
aw(Me.TabControl1.TabPages.Count + 1) = wb
以 上是为了实现类似QQ的或火狐的浏览器添加标签页的功能,动态生成TABPAGE页,然后加入一个WebBrowser控件,现在的问题是,如何将这个动 态添加的webbrowser控件存到数组中,以便以后调用,wcons(Me.TabControl1.TabPages.Count + 1) = wb这是一个数组,声明为public dim wcons as webbrowser,但是运行时总报错,说没有声明,请问如何声明,在线等