Results 1 to 4 of 4

Thread: Copying an array to a listbox?

  1. #1

    Thread Starter
    Addicted Member ProgrammerJon's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    203

    Question Copying an array to a listbox?

    How can I copy an array to a listbox?

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Use an arraylist instead and you can bind directly to the listbox's datasource.

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52
    Dim arText() As String = {"", "Red", "White", "Blue"}
    ListBox1.DataSource = arText
    Iouri Boutchkine

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Cool you can bind to an array too, anything that implements IList or IListSource. Then if you don't want to bind to it you can add it like this:
    VB Code:
    1. Dim arText() As String = {"", "Red", "White", "Blue"}
    2.         ListBox1.Items.AddRange(arText)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width