Results 1 to 4 of 4

Thread: listview checkbox problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    27

    listview checkbox problem

    All

    I have a listview and i want to show the checkboxes after i click a button

    Im using the code below

    Me.lstCustomers.CheckBoxes = True

    but this doesnt show the checkboxes until i click on am item in my list view, and then it only shows the checkbox for the selected item??

    can anyone tell me how to get the checkboxes visible (Or hidden) at the click of my button please

    thanks

    Gibbo

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: listview checkbox problem

    The solution for this problem that I have found is to loop through the list of items and set the CheckBox value.

    VB Code:
    1. Dim oItem As ListItem
    2.    
    3.     ListView1.Checkboxes = True
    4.    
    5.     For Each oItem In ListView1.ListItems
    6.         oItem.Checked = False
    7.     Next

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    27

    Re: listview checkbox problem

    thankyou

    That will do nicely although i did wonder if looping through several thousand records might not be that fast and hoped there would be a quicker way

    thanks again

    gibbo

  4. #4
    Junior Member
    Join Date
    Sep 2006
    Posts
    18

    Re: listview checkbox problem

    In VB IDE set Listview property View = List and Checkboxes = true Try It

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