tags:

views:

121

answers:

2

Making a simple form that is to step through a program iteratively.

How can I get it to run a method each time a user clicks a button and wait once it is finished for the next click?

Thank you.

+1  A: 

You want to create a method that gets called when it sees the "OnClick" event.

The simplest way to do this is to double-click the button in the GUI Form Designer, and it will go to the code page and start the method for you with the correct syntax.

ewall
+1  A: 

Maybe I'm not understanding your question very well, but is it like the "Next" button on a Wizard? You can have a State variable to store the current "state", so at starup its has the value 1. when click "Next" then do the code for State=1 and then change to State=2 and so on.

Inside you Click event you can have a case statement to proceed according

Daniel Luyo
Good point... I wasn't clear on the request either, but your suggestion of a state machine pattern makes sense.
ewall