Results 1 to 4 of 4

Thread: Remove ListView Item That user selected

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    Unhappy Remove ListView Item That user selected

    Anyone can show me how to remove the listview item that user selected ?

    in my listview i have the data below

    name age sex hobby

    1 1 1 1
    2 2 2 2
    3 3 3 3

    if the user click at name number 2 how do i remove the row of it ????
    thanx


    VB Code:
    1. Remove ListView Item That user selected

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    VB Code:
    1. ListView1.Items.Remove(ListView1.SelectedItems.Item(0))
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2004
    Posts
    108

    thanx for the helping

    thanx for the helping, it works


    now i have another problem is that

    after i remove the item, how i want to get the value that before removing ???

    example

    Name age sex hobby
    1 1 1 1
    2 2 2 2
    3 3 3 3


    when i remove the name number 2, can i get the sex value that name is number 2 ????
    like

    when i remove the name number 2 and i will get the sex value is number 2

    thanx

  4. #4
    Lively Member ayan's Avatar
    Join Date
    Jan 2004
    Posts
    112
    VB Code:
    1. dim l as listviewitem=listview1.selecteditems.item(0)
    2. dim s as listviewitem.subitem
    3. for each s in l.subitems
    4.   messagebox.show(s.text)
    5. next

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