I have a form with a bunch of tabs on it, but I don't want them to all be visible all the time. I've tried
For Each t In TabControl1.TabPages
t.Hide()
Next
TabControl1.TabPages("DateRange").Show()
in order to hide them all on doc load and then .Show() for just the tabs that I want at that time, but that apparently doesn't work that way, as all the tabs are still visible.
Then I tried
Private tabs As TabControl.TabPageCollection
For Each t In TabControl1.TabPages
tabs.Add(t) ' Object reference not set to an instance of an object. '
TabControl1.TabPages.Remove(t)
Next
TabControl1.TabPages.Add(tabs("DateRange"))
but I get a tabs is not set to an instance of an object... And I get errors if I try to use
tabs = New TabControl.TabPageCollection
its frustrating that .Hide or .Visible don't do what they are supposed to.