Make a new “web Site” : “File”, “New Web site”
Add a button and 3 labels to your new site.
Double click the button and you get to:
“Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click” method, in the code behind file.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim numberList As New List(Of Integer)
'Add nomber to list
numberList.Add(11)
numberList.Add(12)
Label1.Text = ""
‘loop through list
For Each Items As Integer In numberList
Label1.Text = Label1.Text & " " & Items.ToString()
Next
'clear list
numberList.Clear()
Label2.Text = ""
For Each Items As Integer In numberList
Label2.Text = Label2.Text & " " & Items.ToString()
Next
'Give list Random Number
Dim RandomNumber As Integer
For i As Integer = 0 To 5
RandomNumber = Int((100 * Rnd()) + 1)
numberList.Add(RandomNumber)
Next
Label3.Text = ""
For Each Items As Integer In numberList
Label3.Text = Label3.Text & " " & Items.ToString()
Next
End Sub
tirsdag 4. mai 2010
Abonner på:
Legg inn kommentarer (Atom)
Ingen kommentarer:
Legg inn en kommentar