Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default State Map, Mouse Position Question

Greetings,

Using Excel 2003, have a userform with an image of the US States.
What's a good way to show which state i am hovering over and have a
mouse click event return the state name.

I was trying to use the mouse move x, y, but this only works for me if
the state is semi-square, unsure how to do it for Texas, California,
Idaho, etc.


code snipet...
Private Sub Image1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
If Xval = 35 And Xval <= 51 And YVal = 16 And YVal <= 24 Then
UserForm1.Caption = "Washington"
Else

If Xval = 32.25 And Xval <= 59 And YVal = 38.25 And YVal <= 56 Then
UserForm1.Caption = "Oregon"
Else
UserForm1.Caption = X & " XVal" & " " & Y & " YVal"
End IF
End If

Thank you
RonS

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse-Over State on Graphic Button TheVisionThing Excel Programming 6 November 18th 05 05:17 AM
Mouse pointer position, excel2002 tc Excel Programming 1 May 23rd 05 05:20 PM
mouse position in EXCEL Franz Excel Programming 6 February 11th 05 05:55 PM
Mouse Position Max Potters Excel Programming 3 September 28th 04 06:09 PM
position mouse cursor in msg box swatsp0p[_2_] Excel Programming 2 September 24th 04 07:12 AM


All times are GMT +1. The time now is 09:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"