PDA

Click to See Complete Forum and Search --> : Image swaping


Gumppy
Jan 16th, 2000, 10:26 AM
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?

Maartin
Jan 16th, 2000, 04:55 PM
I have a alternate for you, download the file named img.exe from the following url http://www.freedrive.com/ASP/PostFolderShortcut.asp?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
dinamite@onwe.co.za
-----------------------