Programatically Add Tab with Controls

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
 
M

meh

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

meh
 
H

Herfried K. Wagner [MVP]

* "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)
///
 
M

meh

As usual Herfried your untested code works like a "top"! (or new tab page in
this case)

thx
meh
 
M

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????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top