Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21116

Have a listbox randomly pick to remove either the odd numbers or the even numbers

$
0
0
Hi there folks. I got this math game to help show students the difference between odd numbers and even numbers between 1-25, but I was wondering if there was a way for vb6 to remove either all the odd numbers, or all the even numbers from a list box called numlist.
But the trick is I would like the program to do it randomly, choose either even or odds.

Now I can have the listbox remove them by going

numlist.removeitem - the position of the number, as they are all in order from 1-25., but I'm stuck on trying to get it to pick at random either odds or evens. Has anyone ever done something like that before?

THanks!

Viewing all articles
Browse latest Browse all 21116


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>