hansaplast
Programmer
The selection anchor in a listview is not resetted when SelectedItems.Clear is called.
Place a ListView with a few items on a from. Next, set ListView.View = "Details". Add a button and add the folowing code
Select two or more (not all) items and press the button. After it is pressed hold SHIFT and DOWN arrow. In my case the previously selected items (before pressing the button) are reselected. How is this possible and is there a way to reset the selection anchor?
Whatever you do will be insignificant, but it is very important that you do it. (Mahatma Gandhi)
Place a ListView with a few items on a from. Next, set ListView.View = "Details". Add a button and add the folowing code
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim idx = Me.ListView1.FocusedItem.Index
If idx < Me.ListView1.Items.Count - 1 Then idx = idx + 1
Me.ListView1.SelectedItems.Clear()
Me.ListView1.Items(idx).Selected = True
Me.ListView1.Items(idx).Focused = True
Me.ListView1.Focus()
End Sub
Whatever you do will be insignificant, but it is very important that you do it. (Mahatma Gandhi)