Hi,
I started this as a titled thread "problem with mousedown event". A couple of people have responded but no one seems to understand what's going on. It's kind of odd as this has got to be a simple problem!
Here's the skinny: When I click on the mouse on part of the picture a new picture is suppose to load. In the demo case I clear the old picture out. If you click in the center of the picture or frame the original picture is suppose to load. The code sort of works by doing what I want if I move the mouse cursor off the picture and then back onto the picture. Isn't there some way to make the picture load without having to move the cursor? I suspect that there's a basic mistake in how I set up the control. Here's the code that's associated with spreadsheet 1. Help would be greatly appreciated.
(Private Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, _
ByVal x As Single, ByVal y As Single)
Range("a2").Value = Button
Range("b2").Value = Shift
Range("c2").Value = x
Range("d2").Value = y
' by testing the x,y coordinates you can blink an eye, open a mouth,etc'
If Range("c2").Value < 20 Then
Image1.Picture = LoadPicture("")
Else
Image1.Picture = LoadPicture("C:\Documents and Settings\My Documents\My Pictures\smiley.bmp")
End If
End Sub
I started this as a titled thread "problem with mousedown event". A couple of people have responded but no one seems to understand what's going on. It's kind of odd as this has got to be a simple problem!
Here's the skinny: When I click on the mouse on part of the picture a new picture is suppose to load. In the demo case I clear the old picture out. If you click in the center of the picture or frame the original picture is suppose to load. The code sort of works by doing what I want if I move the mouse cursor off the picture and then back onto the picture. Isn't there some way to make the picture load without having to move the cursor? I suspect that there's a basic mistake in how I set up the control. Here's the code that's associated with spreadsheet 1. Help would be greatly appreciated.
(Private Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, _
ByVal x As Single, ByVal y As Single)
Range("a2").Value = Button
Range("b2").Value = Shift
Range("c2").Value = x
Range("d2").Value = y
' by testing the x,y coordinates you can blink an eye, open a mouth,etc'
If Range("c2").Value < 20 Then
Image1.Picture = LoadPicture("")
Else
Image1.Picture = LoadPicture("C:\Documents and Settings\My Documents\My Pictures\smiley.bmp")
End If
End Sub