minmay吧 关注:0贴子:16
  • 0回复贴,共1

列表框全选/取消全选方法

只看楼主收藏回复

Private Sub 全选_Click()
Me.列表框.SetFocus
Me.列表框.Selected(Me.列表框.ListCount-1)=True
DoEvents
SendKeys "^+{HOME}", True
Me.全选.SetFocus
End Sub
Private Sub 取消全选_Click()
Dim 列表项变量 As Variant
Me.列表框.SetFocus
SendKeys "{DOWN}", True
Me.取消全选.SetFocus
For Each 列表项变量 In Me.列表框.ItemsSelected
Me.列表框.Selected(列表项变量).Selected=False
Next
End Sub


IP属地:浙江1楼2015-09-02 09:46回复