Programatically Add Tab with Controls

  • Thread starter Thread starter meh
  • Start date Start date
M

meh

Could someone point to some samples or documentation that would help me
create "on-the-fly" a tab (In an existing TabControl) with a treeview
control on it...



tia
meh
 
Thanks a bunch for the quick reply......Actually I was trying to copy the
main tab as a template.......

meh
 
* "meh said:
Could someone point to some samples or documentation that would help me
create "on-the-fly" a tab (In an existing TabControl) with a treeview
control on it...

Untested:

\\\
Dim tp As New TabPage()
Dim tv As New TreeView()

' Set treeview's properties here.
..
..
..

tp.Controls.Add(tv)
Me.TabControl1.TabPages.Add(tp)
///
 
As usual Herfried your untested code works like a "top"! (or new tab page in
this case)

thx
meh
 
ya know I thought that if I adding a new Tabpage and then assigned it to an
existing tabpage that I would get a clone of the Tabpage......i.e.
Dim tp As New TabPage()

tp = TabPage1

Me.TabControl.TabPages.Add(tp)

But this is not giving me the results I expected. Is the TabPage not an
object in and of itself????
 
Back
Top