chess123mate
Member
I have a tabgroup with 2 tabs. During runtime, I wish to add new ones. Though I can get the tabs added, I cannot seem to add the ListBox that is supposed to go with it.
In the code below, I added '*' to indicate a line I added to try and fix the problem, but (obviously) don't work.
I get the feeling this should have a simple answer...
Any help on this would be appreciated. Thanks,
chess123mate
In the code below, I added '*' to indicate a line I added to try and fix the problem, but (obviously) don't work.
VB.NET:
Dim newTab As New TabPage("Group " + g.userLabel.ToString())
newTab.Name = "Tab" + g.userLabel.ToString
TabGroups.TabPages.Add(newTab)
lb = New ListBox()
lb.CreateControl() '*'
newTab.Select() '*'
newTab.BringToFront() '*'
newTab.Controls.Add(lb)
lb.BringToFront() '*'
Using lb
Name = nam
Size = ListBoxAll.Size 'ListBoxAll is the ListBox on the first tab
Location = ListBoxAll.Location
Visible = True '*'
Enabled = True '*'
Anchor = ListBoxAll.Anchor '*'
lb.BorderStyle = ListBoxAll.BorderStyle '*'
End Using
registerLB(lb) 'Adds an event handler to it
Any help on this would be appreciated. Thanks,
chess123mate