Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image with selectable regions?

Status
Not open for further replies.

Amesville

Programmer
Oct 10, 2011
93
US
Hi Folks

I'm trying to create something that will display an image of the united states, and allow the user to click on one of the states to select it. I know I did something similar many years ago in VB6, but now I'm using .net 2008 and I can't seem to find the right keywords to tell me what control to use or how to do it. This is a Winforms project. Can anyone point me in the right direction?
 

The PictureBox's MouseClick event looks like this:

Private Sub PictureBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick

End Sub

The 'e' property has X and Y (e.X and e.Y) values indicating where in the control the MouseClick occurred. You can map out the XY coordinates that define the boundaries of each state and use that to determine which state was clicked.


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Thank you - that sounds workable. I will give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top