I am unable to use the simple commands
LVFoo.Checkboxes = True and
LVFoo.Checkboxes = False
to show/hide Checkboxes on a ListView (.View = lvwReport, 3 columns) when there are enough items so that it has a vertical scroll bar.
These instructions lead to a corrupted display: there is incomplete display of all ListView items and blank phantom lines show up at the start and end.
A kludgey fix is:
Public Sub ChangeCheckboxesOnLVFoo(blnChecked As Boolean)
Dim intLine As Integer
With LVFoo
.Checkboxes = blnChecked
For intLine = 1 To .ListItems.Count
.ListItems(intLine).Checked = blnChecked
.ListItems(intLine).Checked = Not (blnChecked)
Next intLine
.ListItems(.ListItems.Count).EnsureVisible
.ListItems(1).EnsureVisible
End With
End Sub
Is there a better way?
LVFoo.Checkboxes = True and
LVFoo.Checkboxes = False
to show/hide Checkboxes on a ListView (.View = lvwReport, 3 columns) when there are enough items so that it has a vertical scroll bar.
These instructions lead to a corrupted display: there is incomplete display of all ListView items and blank phantom lines show up at the start and end.
A kludgey fix is:
Public Sub ChangeCheckboxesOnLVFoo(blnChecked As Boolean)
Dim intLine As Integer
With LVFoo
.Checkboxes = blnChecked
For intLine = 1 To .ListItems.Count
.ListItems(intLine).Checked = blnChecked
.ListItems(intLine).Checked = Not (blnChecked)
Next intLine
.ListItems(.ListItems.Count).EnsureVisible
.ListItems(1).EnsureVisible
End With
End Sub
Is there a better way?