|
以下vba是应用于ListView,能否应用于图片上并且有同样效果(鼠标移出图片后图片为不可见)呢?应如何改写?
Private Sub ListView_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Long, ByVal y As Long)
With ListView
If Button = 0 Then
If (x < 0) Or (y < 0) Or (x > .Width) Or (y > .Height) Then
Set .DropHighlight = Nothing
ListView.Visible = False
ShowEffect lvMenuBtn1, 0
ReleaseCapture
Else
If Not ListView.HitTest(x, y) Is Nothing Then
If Not ListView.DropHighlight Is ListView.HitTest(x, y) Then Set ListView.DropHighlight = ListView.HitTest(x, y)
Else
Set ListView.DropHighlight = Nothing
End If
SetCapture .hwnd
End If
End If
End With
End Sub |
|