This tutorial is for those of you with a little Visual Basic experience but are still beginners.
First off say you wanted to make your form print out a number 5 times, 1, 2, 3, 4, and 5. You think "HEY, MICROSOFT IS COOL THEY PROBABLY MADE SOMETHING WITH THE TIMER TO SET THE AMOUNT OF TIME'S IT GOES OFF!!! YEA AREN'T I SMART!!" Well, no. Sorry, but they didn't. Here's how you would do it though.
First you make a form with a single button on it, and a timer. For the button make the code...
mitymer.enabled = TrueOk now that you have that when you hit the button the timer starts. Now above the button code you need to put the declarations, or declaration in this case.
Dim thisoddnumber As Integer = 0
Now that you have the declaration, you can start the timer coding. Double click on the timer so you get to the code view and add this...
thisoddnumber = thisoddnumber + 1 If thisoddnumber = 5 then mitymer.enabled = False
You can make the numbers anything, it doesn't really matter but you also have to change all of them accordingly. I should have the screen shots up later tonight or tomorrow. Thanks for reading, and alert me of any bugs :P
Edited by Logan, 09 August 2009 - 07:09 PM.


Sign In
Create Account


Back to top










