Guyz I totally need your help on this one... What's wrong with this one..... I tried everything but the mouseover effect doesnt work at all. I'll just attach the files
Printable View
Guyz I totally need your help on this one... What's wrong with this one..... I tried everything but the mouseover effect doesnt work at all. I'll just attach the files
VB Code:
Private Sub picOptions_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) With picOptions If (X < 0) And (Y < 0) And (X > .Width) And (Y > .Height) Then 'MouseLeave Call ReleaseCapture Debug.Print "Help" ElseIf GetCapture() <> .hwnd Then 'MouseEnter Call SetCapture(.hwnd) Debug.Print "Hi There" Else 'Normal MouseMove End If End With End Sub
The only problem was that you used or instead of and.
mouseleave still doesnt work... ill try to fix this tom... ill get some sleep. its night here.. but im glad u helped me out... thanks...
how do i make mouseleave work? (just in case i wont figure it out) thanks
the original code works fine if i try to test it in a newly created form.... unfortunately i dont understant why it doesnt work on this particular form...
hmm...by mouse leave I am presuming you mean when a person lifts his finger from the click he made:
VB Code:
Private Sub picOptions_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'your code End Sub
no. im trying to do a mouseover effect... it will change its image when the mouse enters the picture area and will change back to its original picture one the mouse leaves the picture are.. pls. help.. thanks
ok, here is a code i made:
you also need to give your picture object a begining picture from your picture1path.VB Code:
Dim a As Boolean Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If a = True Then a = False Picture1.Picture = LoadPicture("picture1path") End If End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If a = False Then a = True Picture1.Picture = LoadPicture("picture2path") End If End Sub
I tried it and it worked for me.
or you could do:
instead of defining it at design time.VB Code:
Private Sub Form_Load() Picture1.Picture = LoadPicture(picture1path) End Sub
crptcblade has already provided a solution for this... This is the link:
crptcblade's approach and Other thread, same solution (but explained)
Thank you for all the help..