office交流網(wǎng)--QQ交流群號(hào)及微信交流群

Access培訓(xùn)群:792054000         Excel免費(fèi)交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請(qǐng)用微信掃碼)

        

通用的Access列表框全選 全不選 反選的函數(shù)

2017-08-27 15:24:00
zstmtony
原創(chuàng)
5565

來源:Access交流網(wǎng)通用開發(fā)平臺(tái)函數(shù)

作者:tmtony


'列表框全選函數(shù)

Public Function gf_SelectAll(lst As ListBox)
If lst.ListCount = 0 Then Exit Function
Dim i As Integer
For i = 0 To lst.ListCount - 1
lst.Selected(i) = True
Next
End Function

'列表框不全選函數(shù)
Public Function gf_DeSelect(lst As ListBox)
If lst.ListCount = 0 Then Exit Function
Dim i As Integer
For i = 0 To lst.ListCount - 1
lst.Selected(i) = False
Next
End Function

'列表框反選函數(shù)
Public Function gf_Reverse(lst As ListBox)
If lst.ListCount = 0 Then Exit Function
Dim i As Integer
For i = 0 To lst.ListCount - 1
lst.Selected(i) = Not lst.Selected(i)
Next
End Function
分享
文章分類
聯(lián)系我們
聯(lián)系人: 王先生
Email: 18449932@qq.com
QQ: 18449932
微博: officecn01
移動(dòng)訪問