11-14-2010, 01:31 PM
Random selection from list?
|
11-14-2010, 01:46 PM
This?
Quote:I'm trying to create a program that is a contest. Where you enter names in a input box and they are stored in the listbox. After the names are stored, you click a button and it picks a name at random from the listbox and displays the winner's name in a label. Any ideas? -question by Sherri Add two buttons, a textbox, and a listbox. Button1 will add the name in text box 1 to the list box Button2 will display a message box with the answer Paste this code. Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click This should work for you. If you don't understand what it's doing, let me know and i will break it down and comment it. Its better that you know what's going on, then just copy/paste this to your project. That way, it will sink in and help you later down the road. I code at http://tech.reboot.pro
|
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
[How to] Create random strings(upper,lower and integers)[Src] | Modestep | 11 | 2,948 |
05-14-2011, 02:17 AM Last Post: モrainee |
|
[Snippet] Random pick from list (Range) | euverve | 0 | 693 |
05-12-2011, 08:22 AM Last Post: euverve |
|
[Tut] Generating Random Strings (200 Random Results = LIMIT) [Tut] | Resistance | 7 | 1,860 |
04-12-2011, 03:18 PM Last Post: Resistance |
|
Generate Random Numbers & Letters [ Small Function ] | MYPE | 22 | 4,162 |
04-02-2011, 05:25 PM Last Post: Pyratepig |
|
Need help with generating random fixtures | Fragma | 6 | 1,764 |
03-15-2011, 12:35 PM Last Post: Fragma |
Users browsing this thread: 2 Guest(s)