Results 1 to 10 of 10

Thread: List View *** RESOLVED******

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    East
    Posts
    8

    List View *** RESOLVED******

    Hello

    I have created a entry form that has a couple of comboboxes

    text boxes extc.. Now I also have a listview in the detail view that I am using to store some of these values that the user enters Now all I need to know is how do I delete a row that the user has selected

    I know I will use the listview.checkboxes to see if the user has selected that item but today I seem to be having a mental lapse

    thanks for the assistance
    Last edited by vbnet20; Jul 2nd, 2003 at 01:48 PM.

  2. #2
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    VB Code:
    1. ListView1.CheckedItems.Item(0).Remove()
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    East
    Posts
    8
    Thanks

    It works on the first item I try to delete however if I scroll up or down and try to delete another checked item it doesnt delete the item that I checked off so I used the following code to only delete the checked item,
    If ListView1.CheckedItems.Item(0).Checked = True Then
    ListView1.CheckedItems.Item(0).Remove()
    End If

    but I still have the problem of deleting items any suggestions
    Thanks

  4. #4
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    FYI, you need to check if there are any CheckedItems (if .Count > 0). In addition, when you're testing a boolean expression, you don't need to do "if BooleanValue = true then" -- just do "if BooleanValue then".

    The CheckedItem collection will ONLY contain listview items that are checked, so you don't need to test if the checked value is true. If you want to delete all the checked items, then just remove the index 0 item .Count times.
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

  5. #5

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    East
    Posts
    8
    Thanks
    VictorB212

    Do you know of any good books out there that talks
    extensively about windows controls

  6. #6
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    I haven't bought any myself, but I'd say a trip to your local Barnes & Noble or other big bookstore should prove fruitful -- there are lots of VS.NET books out there. A search tip -- books on "Windows.Forms" should contain lots about controls.
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by vbnet20
    Do you know of any good books out there that talks
    extensively about windows controls
    I have Mastering Visual Basic .NET (Sybex) . It's reference book contains 1200 pages . It's great book . In intermediate level , it talks about ListView and TreeView controls in details .

  8. #8
    Fanatic Member
    Join Date
    Jun 2001
    Posts
    521
    Pirate: Does it talk about altering them (like adding 3-state checkboxes or putting icons in the listview header)?
    I have two simple requests: 1) Use useful and specific topics. 2) Modify your topic to include [Resolved] when you problem has been resolved. Both of these make the bulletin boards more useful and efficient. Thanks.

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by VictorB212
    Pirate: Does it talk about altering them (like adding 3-state checkboxes or putting icons in the listview header)?
    I was going through the book but never mentioned these issues . It talks about sorting & and stuff but it's really more than intermediate level . Here is the content (weird they didn't mention it ) : http://www.sybex.com/sybexbooks.nsf/...e!OpenDocument

  10. #10

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    East
    Posts
    8
    Yeah Pirate


    I have a couple of books Programming Visual Basic.net
    and Programming Windows using Visual Basic.net and they cover
    some controls but they donot seem to cover advanced topics and these books are considered intermediate to advanced and funny thing victorb I was just in the book store yesterday trying to find a book that covered listview,datagrid or anyother windows contol in great detail. Like for example most books that talk about the datagrid use a database suppose you want to work with arrays
    I know how to but I am just using that as an example

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