Public Class Form1
Private Function RandomNumber(ByVal min As Integer, ByVal max As Integer) As Integer
Dim random As New Random()
Return random.Next(min, max)
End Function 'RandomNumber
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim planetcount = RandomNumber(1, 10)
While (planetcount > 0)
planetcount -= 1
'Code here =D
End While
End Sub
End Class
I figured since there wasn't much code yet, might as well put it all.
where it says " Code here =D " I want to put the panel, but if i do this
...
dim panel as panel
...
the next time the program loops it will create a panel with the SAME NAME giving a code conflict.
I want the code to be modifiable in the future so i can have many more, so i cannot do it manually "planet1, planet2, Etc"
So how would i make a loop that would name the panels with ("Planet"+ planetcount)= Planet1, Planet2, etc.? or something like that so that the names become unique, no matter how many loops the program goes through.
Thanks for reading,
Liam