Inverses the selection in either ListBox or ListView
Inverses the selection in either ListBox or ListView
Rate Inverses the selection in either ListBox or ListView
(1(1 Vote))
'eMail: [email protected] [Errors, Feedbacks, etc.]
'* **************************************************** *
' Inverses the selection in either ListBox OR ListView *
'* **************************************************** *
'IN:
' lo - ListBox OR ListView OBJECT reference
'OUT:
' lOUT_ERROR - Gives error number if occured, else 0
Public Sub InverseSelection(lo As Object, Optional lOUT_ERROR As Long = 0)
On Error Goto errIS
If Not (TypeOf lo Is ListBox Or _
TypeOf lo Is ListView) Then
Exit Sub
End If
Dim l As Long, lCount As Long
lCount = IIf(TypeOf lo Is ListView, _
lo.ListItems.Count, lo.ListCount) - 1
If lCount <= 0 Then Exit Sub
For l = 0 To lCount
If TypeOf lo Is ListView Then
lo.ListItems(l).Checked = Not lv.ListItems(l).Checked
Else
lo.Selected = Not lo.Selected
End If
Next l
Exit Sub
errIS:
lOUT_ERROR = Err.Number
Err.Clear
End Sub
Inverses the selection in either ListBox or ListView Comments
No comments yet — be the first to post one!
Post a Comment