VB里Picture控件的问题

来源:百度知道 编辑:UC知道 时间:2024/05/15 10:01:24
Private Sub Form_Load()
Picture1.Picture = LoadPicture("1.bmp")
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Picture = LoadPicture("2.bmp")
End Sub
'我想让鼠标停在picture1上的时候loadpicture("3.bmp")
'移开鼠标后又让picture1 ;pad[octire("1.jpg")
'不要使用MouseMove!该怎么做!是不是要判断鼠标指针是否在此控件上啊?谢谢!
谢谢·不是说了不要使用MouseMove嘛!没有别的办法么?

Private Sub Picture1_Mousemove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Picture = LoadPicture("3.bmp")
End Sub

Private Sub form1_Mousemove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.Picture = LoadPicture("1.jpg")
End Sub

==================不好意思 没看到你下面那句====
Public Declare Function GetCursorPos Lib "user32" (lpPoint As pointapi) As Long
Type pointapi
x As Long
y As Long
End Type
获得鼠标的位置后 加个时间控件 每100毫秒就策一下 ,如果他的位置超出你的图片框 那么就1.jpg else 就3.bmp