Randomizing text from Listbox?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Randomizing text from Listbox?

  1. #1
    Join Date
    Mar 2007
    Posts
    1

    Randomizing text from Listbox?

    Hi

    i have a list box which contains around 20 lines of data, I would like to import each of these into a button in a random order.

    Apprantely, the best method is to get a random item from the listbox, using a Random object to generate a random number and use that as an index to get the corresponding item from the list.

    Anyone have any idea how to do this?

  2. #2
    Join Date
    Jan 2007
    Posts
    112
    dim rnd as new random
    dim index as integer = rnd.next(0,listbox1.items.count)

Similar Threads

  1. Issues importing text into a listbox
    By lodey in forum VB Classic
    Replies: 5
    Last Post: 04-05-2005, 02:39 PM
  2. Replies: 0
    Last Post: 08-23-2002, 12:48 PM
  3. Pass a text selected on listbox to a text box
    By folbabe in forum VB Classic
    Replies: 1
    Last Post: 08-23-2002, 06:41 AM
  4. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 11:45 AM
  5. Double Text 1.0
    By George Gilbert in forum vb.announcements
    Replies: 0
    Last Post: 08-19-2001, 11:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center