Avatar of dejandejanovic
 asked on

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

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:
Dim NewLabel as new Label
NewLabel.Name = "LabelTest"
Dim NewTextBox as new TextBox
NewTextBox.Name = "TextBoxTest"

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.
Visual Basic.NET.NET ProgrammingC#

Avatar of undefined
Last Comment

8/22/2022 - Mon
Éric Moreau

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

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.
Éric Moreau

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

Cool, and thanks for help/tips.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck