Results 1 to 2 of 2

Thread: Image swaping

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 1999
    Posts
    33

    Post

    Currently i have written some code where it swaps images when the mouse goes over. But for some strange reason it only works when The mouse goes over the image from the bottom. If u go from the top down then it doesnt get selected tell it reaches the bottom point. The code follows.

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Y <= imgSingle.Top + imgSingle.Height And Y >= imgSingle.Top - 5 And X >= (imgSingle.Left) And X <= imgSingle.Left + imgSingle.Width Then
    imgSingle.Visible = False
    imgSingleOver.Visible = True
    Call sndPlaySound(ByVal "D:\Projects\DBZFighters\sounds\misc\over.wav", SND_ASYNC)
    ElseIf Y <= imgMulti.Top + imgMulti.Height And Y >= imgMulti.Top - 5 And X >= (imgMulti.Left) And X <= imgMulti.Left + imgMulti.Width Then
    imgMulti.Visible = False
    imgMultiOver.Visible = True
    Call sndPlaySound(ByVal "D:\Projects\DBZFighters\sounds\misc\over.wav", SND_ASYNC)
    ElseIf Y <= imgSet.Top + imgSet.Height And Y >= imgSet.Top - 5 And X >= (imgSet.Left) And X <= imgSet.Left + imgSet.Width Then
    imgSet.Visible = False
    imgSetOver.Visible = True
    Call sndPlaySound(ByVal "D:\Projects\DBZFighters\sounds\misc\over.wav", SND_ASYNC)
    ElseIf Y <= imgExit.Top + imgExit.Height And Y >= imgExit.Top - 5 And X >= (imgExit.Left) And X <= imgExit.Left + imgExit.Width Then
    imgExit.Visible = False
    imgExitOver.Visible = True
    Call sndPlaySound(ByVal "D:\Projects\DBZFighters\sounds\misc\over.wav", SND_ASYNC)
    Else
    imgSingle.Visible = True
    imgSingleOver.Visible = False
    imgMulti.Visible = True
    imgMultiOver.Visible = False
    imgSet.Visible = True
    imgSetOver.Visible = False
    imgExit.Visible = True
    imgExitOver.Visible = False
    End If
    End Sub

    Any ideas, how i could get this to work from both directions?

  2. #2
    Lively Member Maartin's Avatar
    Join Date
    Jan 2000
    Location
    Benoni, Gauteng, South-Africa
    Posts
    99

    Post

    I have a alternate for you, download the file named img.exe from the following url http://www.freedrive.com/ASP/PostFol...sp?fsc=2574178

    This work well but is does have limitations, id does solve the up and down problem that you have, it also works on form that can be resized.

    Hope it helps you.

    ------------------
    -----------------------
    Maartin
    [email protected]
    -----------------------

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