tabpage and inheritance

S

Sam

Hi,
I need to add programmatically several tabpages to a tab control. Those
tabpages are all the same (i.e they contain a textbox and a listbox,
and a button).

How can I create my own tab control so that when I add a tabpage, it
will add also the other components ?

Regards
 
S

Sam

Actually I've found out. I've inherited the tabpage control and created
a user control. Works just fine :)
 
P

Phill. W

Sam said:
Actually I've found out. I've inherited the tabpage control and created
a user control. Works just fine :)

Sam,

And how do you go about adding these into a TabControl?

I've succeeded in creating my own TabPage derivatives, but
/haven't/ yet found any way of using the Forms Designer to add
them into a TabControl - I always have to "hack" the Designer
-generated Source Code.

TIA,
Phill W.
 
M

Mick Doherty

And how do you go about adding these into a TabControl?
I've succeeded in creating my own TabPage derivatives, but
/haven't/ yet found any way of using the Forms Designer to add
them into a TabControl - I always have to "hack" the Designer
-generated Source Code.

TIA,
Phill W.

http://dotnetrix.co.uk/tabcontrols.html --> TabControl using Custom
TabPages.
 
S

Sam

Phill,
Each of my tabpages is a user control inherited from the tabpage base
control.
To add one to my tab, I just do:

'my custom tabPage
Dim tabPage As QueryTabPage

'add the tabpage to the tab control
myTabCtrl.Controls.Add(tabPage)

and it should work just fine...
I don't use the designer to add my tabpages,but what would be the point
anyway...

cheers
 

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