by Patrick Lockefeer (IV) (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 8th February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Generate Random Decimal Numbers and add them to a ListBox
API Declarations
Controls :
Listbox Name ; List1
Commandbutton Name ; Command1 Caption ; Add to List
'Set List Property Sorted = True (if you want sorted values )
Private Sub Command1_Click()
Randomize
'In this example the highest value is 0.99 (Change the value of (Rnd * 1) in a higher value if you want random values above zero)
List1.AddItem Int(Rnd * 1) & "." & Int(Rnd * 10) & Int(Rnd * 10)
End Sub