Results 1 to 4 of 4

Thread: Listbox

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    Listbox

    how would you clear a listbox, like with a button.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Listbox

    How do you add an item? You call the Add method of its Items collection. So, how do you suppose you clear the items?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    Hyperactive Member Vexslasher's Avatar
    Join Date
    Feb 2010
    Posts
    429

    Re: Listbox

    Removes all listbox items
    vb Code:
    1. ListBox1.Items.Clear()

    Removes a single selected listbox item
    vb Code:
    1. ListBox1.Items.Remove(ListBox1.SelectedItem)

  4. #4

    Thread Starter
    Member
    Join Date
    Dec 2010
    Posts
    37

    Re: Listbox

    thanks Vexslasher!

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