Results 1 to 10 of 10

Thread: MouseOver Problem... Help Needed

  1. #1

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211

    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 Attached Files
    C++ Programming is overwhelming.

    Dont let it overwhelm you or you'll fall into the oblivion of its perfection

  2. #2
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    VB Code:
    1. Private Sub picOptions_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.    With picOptions
    3.         If (X < 0) And (Y < 0) And (X > .Width) And (Y > .Height) Then 'MouseLeave
    4.             Call ReleaseCapture
    5.             Debug.Print "Help"
    6.         ElseIf GetCapture() <> .hwnd Then 'MouseEnter
    7.             Call SetCapture(.hwnd)
    8.             Debug.Print "Hi There"
    9.         Else
    10.             'Normal MouseMove
    11.         End If
    12.     End With
    13.  
    14. End Sub

    The only problem was that you used or instead of and.

  3. #3

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211
    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

  4. #4

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211
    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

  5. #5
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    hmm...by mouse leave I am presuming you mean when a person lifts his finger from the click he made:
    VB Code:
    1. Private Sub picOptions_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    2. 'your code
    3. End Sub

  6. #6

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211
    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

  7. #7
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    ok, here is a code i made:
    VB Code:
    1. Dim a As Boolean
    2.  
    3. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4. If a = True Then
    5. a = False
    6. Picture1.Picture = LoadPicture("picture1path")
    7. End If
    8. End Sub
    9. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    10. If a = False Then
    11.     a = True
    12.     Picture1.Picture = LoadPicture("picture2path")
    13. End If
    14. End Sub
    you also need to give your picture object a begining picture from your picture1path.
    I tried it and it worked for me.

  8. #8
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    or you could do:
    VB Code:
    1. Private Sub Form_Load()
    2. Picture1.Picture = LoadPicture(picture1path)
    3. End Sub
    instead of defining it at design time.

  9. #9
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    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

  10. #10

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211
    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
  •  



Click Here to Expand Forum to Full Width