Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim newArray() As Integer
- Dim rndNum As New Random
- Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
- lstItems.Items.Clear()
- ReDim newArray(Val(txtArray.Text) - 1)
- addTo()
- End Sub
- Sub addTo()
- For i = 0 To newArray.Length - 1
- newArray(i) = rndNum.Next(1, 10)
- Next
- Array.ForEach(newArray, New Action(Of Integer)(Sub(x) lstItems.Items.Add(x)))
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement