Ok, I don't have any screen shots ATM, so bear with my code-only tut.
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...
Ok 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.Code:mitymer.enabled = True
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...Code:Dim thisoddnumber As Integer = 0
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 bugsCode:thisoddnumber = thisoddnumber + 1 If thisoddnumber = 5 then mitymer.enabled = False![]()


LinkBack URL
About LinkBacks







Reply With Quote






im a code-warrior, see my avatar

Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum