Click here to Skip to main content
16,022,337 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi guys

i want to know if its possible

get randomly one item from listbox and move that item to textbox every 10 seconds

i mean only 1 item in textbox every 10 sec from listbox

thanks a lot

What I have tried:

i tried nothing yet..................
Posted
Updated 9-Dec-21 9:59am
Comments
PIEBALDconsult 9-Dec-21 15:24pm    
Yes, it's possible.
Ashkan X 9-Dec-21 15:31pm    
i will be appreciate if someone help
[no name] 9-Dec-21 16:15pm    
You know how many items are in your listbox so just get a random number between 0 and the number of items. Use that as the index to copy that listbox item to the textbox. Then sleep for 10 seconds and start over.

1 solution

Yes it's possible - it's not even difficult.
Start here: Random Class (System) | Microsoft Docs[^] but you will also need a Timer Class (System.Timers) | Microsoft Docs[^] or a Timer Class (System.Threading) | Microsoft Docs[^] to get your interval.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900