- Home
·
- Miscellaneous
·
- Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox
Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox
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
Rate Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox
(1(1 Vote))
'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
Use a Timer to add ascending numbers (1,2,3,4,5 etc) automatic to a Listbox Comments
No comments yet — be the first to post one!
Post a Comment