locked
displaying increment numbers

    Question

  • Hi

    Could some one help me please, i want to write a code that will display a number from 1 to 500 in order or until i close the program, the number will display everytime i click on the button. Im very new at this so please help me.

    Marcus  

    Wednesday, December 06, 2006 1:16 PM

Answers

  • Do you want increment the number every time you click a button?
    Where do you want display number? (In a textbox I suppose...)

    In a form with a button and a textbox...

    Dim i As Integer = 0
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If i < 500 Then
            i += 1
        End If
        TextBox1.Text = i.ToString
    End Sub

    Wednesday, December 06, 2006 1:24 PM