Nov 22nd, 2004, 06:48 AM
#1
Thread Starter
Addicted Member
MouseOver Problem... Help Needed
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
Attached Files
C++ Programming is overwhelming.
Dont let it overwhelm you or you'll fall into the oblivion of its perfection
Nov 22nd, 2004, 09:14 AM
#2
Hyperactive Member
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.
Nov 22nd, 2004, 10:05 AM
#3
Thread Starter
Addicted Member
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
C++ Programming is overwhelming.
Dont let it overwhelm you or you'll fall into the oblivion of its perfection
Nov 22nd, 2004, 10:08 AM
#4
Thread Starter
Addicted Member
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...
C++ Programming is overwhelming.
Dont let it overwhelm you or you'll fall into the oblivion of its perfection
Nov 23rd, 2004, 02:19 PM
#5
Hyperactive Member
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
Nov 24th, 2004, 08:53 AM
#6
Thread Starter
Addicted Member
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
C++ Programming is overwhelming.
Dont let it overwhelm you or you'll fall into the oblivion of its perfection
Nov 24th, 2004, 10:40 AM
#7
Hyperactive Member
ok, here is a code i made:
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
you also need to give your picture object a begining picture from your picture1path.
I tried it and it worked for me.
Nov 24th, 2004, 10:45 AM
#8
Hyperactive Member
or you could do:
VB Code:
Private Sub Form_Load()
Picture1.Picture = LoadPicture(picture1path)
End Sub
instead of defining it at design time.
Nov 24th, 2004, 08:57 PM
#9
Frenzied Member
crptcblade has already provided a solution for this... This is the link:
crptcblade's approach and Other thread, same solution (but explained)
We miss you, friend...
Rest in Peace, we will take care of the rest of it.
[vbcode]
On Error Me.Fault = False
[/vbcode]
- Silence is the human way to share ignorance
Tec-Nico
Nov 28th, 2004, 02:00 PM
#10
Thread Starter
Addicted Member
Thank you for all the help..
C++ Programming is overwhelming.
Dont let it overwhelm you or you'll fall into the oblivion of its perfection
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width