MouseMove example for Visual Basic

Private Sub LEADImgList1_Click()
   Dim lIndex As Long
   If (LEADImgList1.AllowSelection = IMGLST_ALLOWSELECTION_NONE) Then 'manual selection?
      lIndex = LEADImgList1.HitTest(gLastX, gLastY) 'did we hit an item?
      If ((lIndex >= 0) And (lIndex < LEADImgList1.Count)) Then
         'set item as selected
         LEADImgList1.SelectAll False
         LEADImgList1.Item (lIndex).Selected = True 'make sure the item is selected
      End If
   End If
End Sub
Private Sub LEADImgList1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
   gLastX = x
   gLastY = y
End Sub