Dear all,
I am new in CS, and what I know is basically an event is triggered when we click a button or do something in the form.
I have a button, called number that will generate random number. Lets call it number_btn. I want to add one textbox with one button. This button, call it several_btn will run the event inside number_btn until the value inside the textbox. For example if it is 9 inside the textbox, it will run it 9 times.
My question is on how to run an event inside a button several times. What come in my mind is by putting it inside a function and run a loop. But that way, my variable must be made global then. My variable is local. Is any other way available?
Kindest Regards,
Eryatronika

1 answers
If I've understood it correctly, you can call the PerformClick() method in a loop:
As you'll see, nothing happens if the number in the textbox is less than or equal to zero or can't be parsed to an integer ('number' is then zero).
answered one year ago by:
17279
301
yes vulpes, thank you the PerformClick() works =)