…when I was attempting to set the checked property of a listitem, the control simply toggled the value. Again, I hacked the code and discovered that it was never recognizing the bState variable. I adjusted the code, as shown below, and it works like a charm.
Friend Property Let fItemChecked(ByVal lIndex As Long, ByVal bState As Boolean)
Dim lR As Long
Dim tLV As LVITEM
tLV.iItem = lIndex - 1
tLV.mask = LVIF_STATE
tLV.stateMask = LVIS_STATEIMAGEMASK
Call SendMessage(m_hWnd, LVM_GETITEM, 0&, tLV)
If bState Then
' uncheck
tLV.State = &H2000
Else
' check
tLV.State = &H1000
End If
lR = SendMessage(m_hWnd, LVM_SETITEMSTATE, lIndex - 1, tLV)
End Property
|
Doh! Fixed as suggested. |