Things You'll Need:
- VB.net
-
Step 1
Open VB.net and create a new windows application.
-
Step 2
ListboxAdd a listbox to the form. We are going to use the listbox to add items to it every time the timer control gets exceuted.
-
Step 3
Timer ControlAdd the timer control to your form. Notice how the timer control is not actually shown on the form but instead in a different panel at the bottom.
-
Step 4
Timer PropertiesClick on the timer control and press the F4 key to bring up the timer's property window.
-
Step 5
Enabled PropertyChange the timer's enabled property from false to true.
-
Step 6
Interval PropertyChaneg the timer's interval property to 1000 which is about one second.
-
Step 7
Tick eventDouble click the timer control to bring up the timer's tick event.
-
Step 8
CodeIn the tick event we are going to add the code:
ListBox1.Items.Add(ListBox1.Items.Count)
What this does is add to our listbox the number of items in the listbox each time the tick event executes which we set earlier to 1000 or about every second. -
Step 9
Run the program by pressing the F5 key on your keyboard.
-
Step 10
Final ResultsNotice how the numbers get added to the listbox.















