1

This is my issue: I have a loop 1 to 30 that needs to run a iteration every time that I click the button. basically if i click it should run one iteration and wait for the next click to run the second iteration and so on.

Public Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    For i = 1 To 30 'go to next iteration only when i click the Button1
      do whatever

    next i


end sub

1 Answer 1

1

One option is to add a form level variable (initialized to the bottom value "1") to hold the loop counter and in the button click do a simple IF check if on the variable to see if it is within the range you want to run for (1-30) and then increment the variable as the last step inside the button click.

Sign up to request clarification or add additional context in comments.

1 Comment

glad you understood what I was saying without any code. It's been three years since I used VB.net. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.