PDA

View Full Version : picture will not load on click



rss
11-23-2006, 07:53 PM
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.

(is there another vba forum that's more active?)

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

Ivan F Moala
11-23-2006, 10:33 PM
You should keep to the original thread.

See (Try) my reply to your original thread.

Ken Puls
11-23-2006, 11:27 PM
I'm going to lock this thread down. All replies should be directed back to the original thread at http://www.vbaexpress.com/forum/showthread.php?t=10212.

Also, rss, please try using the VBA tags in your posts. It makes the code much more readable. Just put your code in, highlight it, and press the VBA button in the post reply toolbar.

Thanks!