' Learn how to use a for loop.' You should always use a for loop when the amount of repetitions is known.PublicClass Form1
Inherits System.Windows.Forms.Form
PrivateSub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) HandlesMyBase.Load
'display the numbers from 0 to 9Dim i AsIntegerFor i = 0 To 9
TextBox1.Text = TextBox1.Text & i & ","Next i
EndSubEndClass' Let us take a closer look at our for loop:'----------------------------------------------------------------' For i = 0 To 9' TextBox1.Text = i' Next i'----------------------------------------------------------------' For - for loop' i - use i as our integer' 0 - start value = 0' To - between start and stop value' 9 - stop value = 9' Next - go to next step (if i < 9 then end for loop)'----------------------------------------------------------------'Description:' The for loop will loop from the given start walue to the given stop value.' The amount of loops will then be 10 (first loop i=0).
'-----------------------------------------------------------------------------
Visual Basic .Net Source Code
I hope you found this VB .Net tutorial useful!
Don't forget to mention Apron Tutorials in your References!