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

Avatar of undefined
Last Comment
dejandejanovic

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
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
É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
or
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
dejandejanovic

ASKER
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