Creating TabPage and dynamicaly adding to TabControl

R

RA

Hi

1) I want to create a TabPage class in design mode - how do I do it? What
type of project should I use? Is it going to be a custom control?
2) I have a TabControl that I would like to add to it the TabPage created in
step 1. I don't want to draw the TabPage on the Tabcontrol in design mode,
but to have a few TabPage controls that I candynamicaly load to the
TabControl at runtime.

Thanks
 
M

Mick Doherty

UserControl has a Design Surface.
Create the tabPage as a userControl and when you are done laying out the
controls on it, close the designer and change the inheritance from
UserControl to TabPage.

A TabPage is Inherited from ScrollableControl as is UserControl, so theres
not really much difference between the two other than TabPages can be added
to TabControls.

Don't open the designer whilst the control is inherited from TabPage or the
layout will get messed up. If you need to tweak something on the design
surface then temporarily change inheritance back to UserControl.
 

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