The title may not accurately explain what i would like to do,
Dim BarName As String
For i = 0 To 20
BarName = "Graph1Bar" And CStr(i)
Dim BarName As New PictureBox
Next
I would like to create a new picture box for every instance of a for loop, and intend to change their names based on what iteration of the loop they were made in. Is there any way to do this?
I would also like to be able to call on these variables in a loop, like this:
For i = 0 to 20
Graph1Bar(i).Height = 200
Next
I'm not sure if any of this is possible but some help or explanation would be greatly appreciated!
Me.Controls("Graph1Bar20")...Use a List(Of PictureBox). Iterate the List items, add aName, set theSize, add to theForm.Controlscollection. You can then use the ListItemsto control your Controls.