T
Thorgal
Hello,
I created a UserControl named ucCel. (This is for the moment just a
square with a label where I create a random number.
The problem is the following.
In my code in frmMain i try to create a various amount of ucCels on my
form like this.
Dim arlAlleCellen As New ArrayList
arlAlleCellen = clsCelDA.GetAlleCellen
Dim i As Integer = 0
Dim j As Integer = 0
For Each oCel As clsCel In arlAlleCellen
If i = 3 Then
j = 1
i = 0
End If
Dim ucCel As New ucCel(oCel)
Dim p As New Point
p.X = 0 + (ucCel.Width * i) + 50
p.Y = 0 + (ucCel.Height * j) + 50
ucCel.Location = p
pnlKleineCellen.Controls.Add(ucCel)
i = i + 1
Next
This works almost, but the random number i created in my ucCel is
somethimes the same, it is like it creates the Usercontrol to fast and
it can't create a random number fast enough. How can i solve thist
problem?
I created a UserControl named ucCel. (This is for the moment just a
square with a label where I create a random number.
The problem is the following.
In my code in frmMain i try to create a various amount of ucCels on my
form like this.
Dim arlAlleCellen As New ArrayList
arlAlleCellen = clsCelDA.GetAlleCellen
Dim i As Integer = 0
Dim j As Integer = 0
For Each oCel As clsCel In arlAlleCellen
If i = 3 Then
j = 1
i = 0
End If
Dim ucCel As New ucCel(oCel)
Dim p As New Point
p.X = 0 + (ucCel.Width * i) + 50
p.Y = 0 + (ucCel.Height * j) + 50
ucCel.Location = p
pnlKleineCellen.Controls.Add(ucCel)
i = i + 1
Next
This works almost, but the random number i created in my ucCel is
somethimes the same, it is like it creates the Usercontrol to fast and
it can't create a random number fast enough. How can i solve thist
problem?