by Patrick Lockefeer (XI) (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 17th August 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox
API Declarations
'Please see my other snippets on page 607,609,610 and page 611
'Controls :
'Timer Name : Timer1
'Timer properties settings ; Interval 500 ; Enabled=True
'2 Commandbuttons Name : cmdStart Caption : Start
Name : cmdStop Caption : Stop
'Listbox name : List1
'Europian time : 17/08/2005
'Note : The Number counting will start when you start the program
'Start timer button
Private Sub cmdStart_Click()
Timer1.Enabled = True
End Sub
'Stop timer Button
Private Sub cmdStop_Click()
Timer1.Enabled = False
End Sub
'Add Ascending Numbers to the Listbox
Private Sub Timer1_Timer()
Static Count As Integer
Count = Count + 1
List1.AddItem Count
End Sub
No comments have been posted about Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox. Why not be the first to post a comment about Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox.