VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Generate Random Decimal Numbers and add them to a ListBox

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 )

Rate Generate Random Decimal Numbers and add them to a ListBox




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


Download this snippet    Add to My Saved Code

Generate Random Decimal Numbers and add them to a ListBox Comments

No comments have been posted about Generate Random Decimal Numbers and add them to a ListBox. Why not be the first to post a comment about Generate Random Decimal Numbers and add them to a ListBox.

Post your comment

Subject:
Message:
0/1000 characters