I have a program that allows the user to add steps to a process (tabpages in a control). All tabpages are generated on the fly by duplicating a "template" tabpage and consequently have the same control names such as textboxStepDesc. Here is the hierarchy of the controls to get to textboxStepDesc. Both TabPage1 and TabPage2 are in TabControl1

TabPage1
Panel1
textboxStepDesc
other fields

TabPage2
Panel1
textboxStepDesc
other fields

Since textboxStepDesc exists in Panel1 in both TabPage1 and TabPage2, how do I specify that I want to retrieve the value of textboxStepDesc.text on tabpage2 vs. textboxStepDesc.text on tabpage1?

Use Controls collection,

TabControl1.TabPages("key or Index").Controls("key or index").Controls("key or index")
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.