You can totally deselect the selected item at any time using:
'for single-select controls
If Not ListView1.SelectedItem Is Nothing Then
ListView1.SelectedItem.Selected = False
Set ListView1.SelectedItem = Nothing
End If
'or, for multi-select controls
Dim itmx As ListItem
If Not ListView1.SelectedItem Is Nothing Then
For Each itmx In ListView1.ListItems
itmx.Selected = False
Next
End If
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
Please reply to the newsgroups so all can participate.
"Dean Earley" <de*********@icode.co.uk> wrote in message
news:43***********************@news.zen.co.uk...
: Raoul Watson wrote:
: > Interesting observation is that eventhough the value of selected item is
: > corrrect, the item is not highlighted as it would be when one clicks on
it.
:
: Erm, yeah, I noticed this the other day.
:
: SelectedItem is the item with the focus rectangle (can NOT be unselected)
: Highlighted items (no native property) are items with .Selected = true
:
: When you click an item, it sets both to the item in question, but
: clicking an empty area ONLY unhighlights it, but leaves it "selected"
:
: From my experience, setting .SelectedItem does highlight it as well
though.
:
: --
: Dean Earley (de*********@icode.co.uk)
: i-Catcher Development Team
:
: iCode Systems