Results 1 to 5 of 5

Thread: Problems with List View (URGENT)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    Bangladesh
    Posts
    19

    Unhappy Problems with List View (URGENT)

    Dear Programmers,

    Take my regards. I'm facing some problem with the ListView control and need an urgent help. Any kind of help will be highly appreciated. Please help me if you can.....

    The first problem is REMOVING AN ITEM from the listview . The problem reveals when I want to remove multiple items (Listview multiselect property set to true). There arises the problem with index, I think.

    The second problem is POPULATING listview with system icons just like windows explorer : populating with files and folders, showing appropriate icon and showing file type.

    Please help me if you can. And if you have any ActiveX control that shows Windows Explorer style Folder and File list with checkbox property, send it to me. I want the capability of using these to provide support like Microsoft Backup (Start> Accessories> System Tools> Backup).

    That's all for now.....I'm waiting for reply.. ...Thanks

    Md Emran Hasan
    [email protected]
    emranHASAN

  2. #2
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    To remove items from a listview, always loop from the last row to the first, then the index will always remain the same.

    VB Code:
    1. For Index = listview1.listitems.count to 0 step -1
    2.   ' remove the item
    3.  Next
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  3. #3
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    Adding icons to a listview involves a bit more complex code including the use of ImageLists. If you search this forum you will find others have asked the same question and the answer will probably be posted with them
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  4. #4
    Addicted Member
    Join Date
    Jul 2000
    Location
    Novi Sad, Serbia and Montenegro (formerly known as Yugoslavia)
    Posts
    148
    Originally posted by Blobby
    To remove items from a listview, always loop from the last row to the first, then the index will always remain the same.

    VB Code:
    1. For Index = listview1.listitems.count to 0 step -1
    2.   ' remove the item
    3.  Next
    I agree, but the list item with index 0 thoes not exist! So:
    VB Code:
    1. For Index = listview1.listitems.count to 1 step -1
    2.   ' remove the item
    3.  Next
    ( : ns-code : )
    FCP Products

  5. #5
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512
    ns-code....heheheheh you are quite correct. Good spot! Thats what happens when you write code directly into the forum without testing it
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

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