ListView Question 
Author Message
 ListView Question

If I Remove a ListItem, using a command button click event, how do I stop
the user clicking the delete button and removing the next Item in the list?

    E.g

    When the User Clicks the Delete Button, the following code is run

    Dim i as Integer

    lstvwPatients.ListItems.Remove lstvwPatients.SelectedItem.Index

    ' set listitems selected property to false
    With lstvwPatients
        For i = 1 To .ListItems.Count
            .ListItems.Item(i).Selected = False
        Next i
    End With

Is there a better way ?

Also, does Adding new ListItems change the selected property to True?

TIA



Sun, 29 Aug 2004 23:36:14 GMT  
 ListView Question
Under the ListView1_ItemClick Event this:
        Command1.Enabled = True

Under the Command1_Click Event this:
        If ListView1.SelectedItem Is Nothing Then Exit Sub
        Command1.Enabled = False
        ListView1.ListItems.Remove ListView1.SelectedItem.Index

hth,
s



Mon, 30 Aug 2004 00:17:31 GMT  
 ListView Question
Yes it does thanks


Quote:
> Under the ListView1_ItemClick Event this:
>         Command1.Enabled = True

> Under the Command1_Click Event this:
>         If ListView1.SelectedItem Is Nothing Then Exit Sub
>         Command1.Enabled = False
>         ListView1.ListItems.Remove ListView1.SelectedItem.Index

> hth,
> s



Mon, 30 Aug 2004 03:59:49 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ListView Question too

2. Listview question

3. Listview Question

4. listview question

5. listview questions

6. Listview question

7. Listview question

8. ListBox and ListView questions

9. Customdraw Listview Question....

10. Listview questions

11. ListView Question

12. ListView questions ????

 

 
Powered by phpBB® Forum Software