PDA

Click to See Complete Forum and Search --> : On Mouse Over Equivlencies


Divide_0verride
Nov 17th, 2000, 06:09 PM
Just a forewarning, my spelling sucks... Im am very new to VB [Running VB 6 for a little over a week now], and was wondering if thier was a way to change the picture in the picture box, when it has focus, and then change back when focus is lost. Kinda like ajavascript OnMouseOver Function, and would thier be a way to implement sound for this action 2? Help would be greatly appreciated, I don't have any textbooks, or the MSDN, so every thing i know about VB has just been me experimenting.:confused:

/\/\isanThr0p
Nov 17th, 2000, 08:15 PM
Hm I am not that new to VB. I think there is no real way to do this in normal VB code! Of course you can do a lot of stuff, but To me it seemed to be to complicated, because I never really needed it!

Divide_0verride
Nov 18th, 2000, 10:53 AM
Ahh, oh well. It was worth a shot, thanks alot for taking the time to reply, and you'll be seeing me on the forum a fair bit....

Divide_0verride
Nov 18th, 2000, 02:41 PM
I fooled around a bit, and figured that the code:
Private Sub picBack_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim MouseOverPic As Picture
Set MouseOverPic = LoadPicture("C:\dominatrix\Buttons\BackOnMouse.bmp")
Set picBack.Picture = MouseOverPic
End Sub

and:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Set picBack.Picture = LoadPicture("C:\dominatrix\Buttons\Back.bmp")
End Sub

Have virtually the same effect as a mouse over... ound wont be hard to do now ethier.

wvary
Nov 23rd, 2000, 06:59 AM
That's a nice workaround but there might be a flaw with this approach.

I notice that you check the mouse move event of the form to turn the picture back. Good thinking.

What if you have many controls on the form along with the picture box? You would have to check mouse move event on all shown control to change the picture back.

I would have liked VB to have a mouse leave control event, but i haven't seen it yet.