-
here is what i am trying to do
i want to move a ball from a fixed point to different other fixed points
http://24.112.141.149/test/back.jpg
thats my menu
http://24.112.141.149/test/ball.gif
when form loads this ball is at a fixed point, when the user mousevers the menu items (each menu item has a imgBox over it so when the mouse moves over a item i have a way ot capturing what item they are on..
and i want that ball to come from that fix point and cover the ball thats beside the menu item
i tried playing around with it but i coudn't get anywhere, any code would be greatly appreciated, thank you
-
Create one big PictureBox called picBackGround (put your background image in it).
Create a bunch more little PictureBoxes in an array, all called picBall but make them have different indexes.
Load your ball into picBall(0). This will be the one with the ball in it initially. The others should have no picture loaded in them.
Play with their BorderStyles and their AutoSizes until you're satisfied. (They should all be the same size - the size of the ball, or all on AutoSize)
Then, use this code:
Code:
Private Sub picBall_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Static iLastIndex As Integer
If iLastIndex = Index Then Exit Sub
Set picBall(Index).Picture = picBall(iLastIndex).Picture
Set picBall(iLastIndex).Picture = Nothing
iLastIndex = Index
End Sub
Good luck! Have a ball! :rolleyes: