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?
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?