Link to home
Start Free TrialLog in
Avatar of dejandejanovic
dejandejanovic

asked on

Replicate TabPage, and inside controls (labels, textboxes,etc) of TabControl?

Hi,
I would like to found proper way to replicate TabPage, and it's inside controls. By meaning proper way, as currently I have only in mind to write down long code behind, like:
TabControl1.TabPages.Add(TabPage2)
Dim NewLabel as new Label
NewLabel.Name = "LabelTest"
Dim NewTextBox as new TextBox
NewTextBox.Name = "TextBoxTest"
etc...

I have around 20-30 controls inside TabPage, and I would like to avoid writing long code.

Honestly, I really not sure if there is shortcut of replicating TabPage.

So, need help to understand this issue.

Thanks in advance for help to anyone.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

I would create a user control with all the 20-30 controls on it. then when needed, only one control would need to be created to be added to a tabpage
Avatar of dejandejanovic
dejandejanovic

ASKER

So, if I undestand correctly to create UserControl with necessary controls >> this UserControl could be used as template, and replicate as much as need it.
???
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Cool, and thanks for help/tips.