Is dynamic name possible for controls and Dim in VB.net?

ardy1234567

New member
I want to make a dynamic name for declarations also for control names. Is it possible?

Let say when declaring a variable string the standard is:
Dim str as string

But I want the "str" name changed during runtime influenced by a subroutine similar to this one:

Private Sub declare_variables(name as string)
dim name as string
End sub
declare_variables("Jerry")
Jerry = "1000"
declare_variables("Mike")
Mike="100"
declare_variables("Mike_LastName")
Mike_LastName="Brookes"

Well you get the point.

I know this code will not work. But is there some kind of workaround similar to this one? Is it also applicable for control names? because I want to make tabbed panel and each tabbed panel contains the same check boxes labels and textboxes on the same position same size.

I want to do the initiation and control and loading thru the code and just call them for each tabbed panel instead of dragging objects from the toolbox and renaming them one by one for every tabbed panel.
Using a function and call them by giving a name and let the function rename and declare the rest inside of it using the name that is passed. Well that is the goal for this question. Thanks
Here is the situation in a TabControl1 there are TabPage1 and TabPage2
TabPage 1 contains
1 checkbox named "DV_chk"
2 textboxes named "DV_top" and "DV_left"
TabPage 2 contains
1 checkbox named "BV_chk"
2 textboxes named "BV_top" and BV_left"

As you can see only the DV_ and BV_ names are changed and I want to do this for a lot of more Tabpages when I add
so I need to declare a dynamic names
 
Back
Top