Answer» Code: [Select]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
Code: [Select]... 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 try
Code: [Select]dim panel as new panel with panel .location... .name... end with Something like that should work, although I normally just use arrays. What are you trying to do?
I was trying to make 10 unique panels each with uniquely modifiable statistics. How i set it up in the main post, whenever I tried to change an attribute, it would apply to -ALL- the panels.
|