原来使用microsoft windows common controls (5.0) 即COMCTL32.OCX的时候没有这个问题,现在换了microsoft windows common controls (6.0)即MSCOMCTL.OCX的时候,listview控件只要加载Item就肯定有个Item被选中.点击listview内的空白处也不能使被选中的Item失去焦点. 但这样就出现了问题,当设置listview多选的时候,你即使用鼠标拖拽不选中原来那个listview默认选中的Item,它也会被一起选择到多选里来.(至少那个Item背景也高亮显示).请问有没有办法可以使这个被默认选择的Item在多选的时候不被选进来.或者说点击listview内空白的地方可以使所有的Item的selected均变成false.
Dim itemx As ListItem
Set itemx = ListView1.SelectedItem
If itemx Is Nothing Then Exit Sub
itemx.Selected = False
End Sub
http://community.csdn.net/Expert/topic/3426/3426695.xml?temp=.1719324
http://community.csdn.net/Expert/topic/3427/3427810.xml?temp=8.871096E-02
If ListView1.HitTest(X, Y) Is Nothing Then
Set ListView1.SelectedItem = Nothing
End If
End Sub