tags:

views:

98

answers:

2

we have users in each region of the world. I would like to create an environment picker that shows up a map on the form and has a link for each region. So if i was in NY i would click NY and would get the NY environment. Any ideas of doing this dynamically in winforms as opposed to having a static map image.

+1  A: 

I may be misreading the question, but it sounds like you want something akin to how the old-school Windows time zone picker worked. The rest of this is based on that assumption, so if I'm wrong, feel free to disregard.

You are, in effect, dealing with an image of a world (or national, or regional, etc.) map, with clickable "hotspots." Given that, you need some form of image to start with. :)

Now you have two choices: You can embed a bitmap image of your map in the application, or you can draw it yourself using GDI+ primitives. Either way, you would display it on the form, and wire up the MouseUp event for the various hotspots. (The MouseUp event, I believe, includes the X,Y coordinates of where the user clicked.)

If you wanted to get really fancy, you could change the mouse pointer on the MouseOver event if the user is in the defined hotspots.

Either way, it's a great UI -- very visual, very in tune with how people think -- but it will be time-intensive to code correctly.

John Rudy
A: 

Have you tried using MapPoint and its API? You'd probably want to use their web service. Just google "mappoint api" for some examples and documentation.

Tom Juergens