Don't believe you can still use the 'highlighted' focus colour when the listview no longer has the focus - that is a Windows function.
However, to make it clearer to users what has been 'selected', each time an item is selected, you can change the foreground colour e.g.
(with approp Dim's for iIndex and iColumns (and setting iColumns to the approp value)
Code:
lvMyListView.SelectedItem.ForeColor = vbBlue ( or vbRed .... etc)
For iIndex = 1 To iColumns
lvMyListView.SelectedItem.ListSubItems(iIndex).ForeColor = vbBlue
Next
[N.B. In the For ... Next loop, I have no idea why 'Forecolor' is appearing as 'For ecolor'!!! - I have tried everything I can think of to correct, but .... anyone at DevX have an idea?]
We use this, for example, when users are clicking on 'presented' items when doing a Bank Reconciliation.
P.S. You can also use '.SelectedItem.Checked = True', if you tick 'Checkboxes' in the ListView Properties.
Hope this helps
Greg
Bookmarks