Creating TabPage and dynamicaly adding to TabControl

  • Thread starter Thread starter RA
  • Start date Start date
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
 
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.
 
Back
Top