If LvwQuery.ListItems.Count > 0 Then
        For fori = 1 To LvwQuery.ListItems.Count
             LvwQuery.ListItems(fori).Checked = True
         Next
   End If想要效果:全选后,所以的条目变成像鼠标选的一样,变成蓝色现在的效果:显示没有一点反应,但其实是全选了的

解决方案 »

  1.   

    '这样试试:
    For fori = 1 To LvwQuery.ListItems.Count
         LvwQuery.ListItems(fori).Checked = True
         lvwquery.ListItems.Item(fori).Selected = True
    Next
      

  2.   

    一种办法是把LvwQuery的HideSelection属性设置成False这时会有全选的效果,不过不是蓝色的,而是灰色的。
      

  3.   

    这样试一下,让lvwQuery重新获得焦点。  If LvwQuery.ListItems.Count > 0 Then
            For fori = 1 To LvwQuery.ListItems.Count
                 LvwQuery.ListItems(fori).Checked = True
                 lvwquery.ListItems.Item(fori).Selected = True
             Next
            LvwQuery.SetFocus
       End If