'Private Sub Picture1_Click() ' RaiseEvent Click 'End Sub ' Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button = 1) Then RaiseEvent Click End Sub
[解决办法] 没有出现LZ说的问题,如果LZ的代码确实有问题,那肯定是出现在 Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If 0 <= X And X <= Picture1.Width And 0 <= Y And Y <= Picture1.Height Then SetCapture Picture1.hwnd If Val(ys) < 1 Then ys = Val(ys) + 1 '鼠标移出 End If Else ReleaseCapture '鼠标移入 ys = 0 End IfEnd Sub
上,lz可以判断是否进入或离开Picture1的时候,加入边缘保证,即 If dx <= X And X <= Picture1.Width-dx*2.... 以确保能ReleaseCapture