Results 1 to 2 of 2

Thread: Type mismatch when I try to remove a listbox item I click on? :)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    Type mismatch when I try to remove a listbox item I click on? :)

    Hello there folks!

    I have a listbox called YourGameList. I make a play list of games I want to play in that listbox, but sometimes I would like to remove an item from that playlist/listbox.

    My hope is to click on the item I want to remove and the selected item is removed. Next, the listbox items under the removed item moves up so there is no "empty spot" where the removed item was.

    I tried this, but I get a type mismatch error.

    YourGameList.RemoveItem YourGameList.List(YourGameList.ListIndex)

    The index could be any number though, as sometimes I might want to remove the top/0 index item, or 3 down, etc.

    Did I miss a step here??

    Thanks a ton!!

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Type mismatch when I try to remove a listbox item I click on? :)

    Code:
    YourGameList.RemoveItem
    expects a valid index number


    Code:
    YourGameList.List(YourGameList.ListIndex)
    This would be the content of that list item not the index number

    This would be correct
    Code:
    YourGameList.RemoveItem YourGameList.ListIndex

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