Community of VE/MapPoint Users and Developers
This is a discussion on Custom context menu within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm asking here after searching this forum and googling for hours - I thought I'd find an answer but no ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Custom context menu Using the ActiveX control and .NET. All I'd like to do is create my own context menu when the user right-clicks a pushpin. I can trap when the right mouse button is clicked, but I can't seem to figure out how to get the pushpin object (or even just the Name property) from the user's click. You can get the x,y coordinates of the click event, but how do I find a pushpin from that? Thanks, Mike |
| |||
|
Funny how you can search differently after you post a question. This seems to get the name ok, which I can work with, would still be open to suggestions. Code: private void axMap_SelectionChange(object sender, AxMapPoint._IMappointCtrlEvents_SelectionChangeEvent e)
{
MapPoint.Pushpin pushPin = (MapPoint.Pushpin)e.pNewSelection;
MessageBox.Show(pushPin.Name);
}
|
| |||
|
FWIW, this is what I'm doing so far, but really, I'm not sure of the best way. I just need to put together some demo/proof of concept real quick. Code: private void axMap_SelectionChange(object sender, AxMapPoint._IMappointCtrlEvents_SelectionChangeEvent e)
{
MapPoint.Pushpin pushPin = (MapPoint.Pushpin)e.pNewSelection;
if (pushPin == null)
{
// I guess other objects besides pushpins can get selected.
//MessageBox.Show("pushPin is null");
}
else
{
ContextMenu cm = new ContextMenu();
cm.MenuItems.Add("Do something with " + pushPin.Name); // To do: Wire the event handlers.
cm.Show(axMap, new Point(42, 42)); // Figure out how to position.
//MessageBox.Show(pushPin.Name);
}
}
Mike |
![]() |
| Tags |
| context, custom, menu |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Click events of context menu are not firing.... | Learner | MapPoint 2006/2009 Discussion | 6 | 05-12-2008 02:33 PM |
| By Right-click displaying context menu on map | Banu | MapPoint 2006/2009 Discussion | 19 | 10-16-2007 07:46 AM |
| Disable Context menu | Anonymous | MapPoint 2006/2009 Discussion | 10 | 05-27-2005 01:03 PM |
| Extending MapPoint - How about the Context Menu Enhancements | Anonymous | MapPoint 2006/2009 Discussion | 2 | 02-10-2004 09:38 AM |
| VB.NET & overriding the map point context menu... | Anonymous | MapPoint 2006/2009 Discussion | 0 | 09-05-2002 08:25 AM |
Ski Chalet
Fancy a ski chalet? Relax in comfort and style between skiing sessions. Holiday Hypermarket makes it easy for you to specify what kind of accommodation you want.
Flights to Portugal
Find and book flights to Portugal. Travel Counsellors can help with travel to Portugal including flights and accommodation.
Turkey Holidays
Istanbul is Turkey's prime attraction as it has the most beautiful mosques and palaces of the country; it has Byzantine churches and Roman temples. Book Turkey Holidays online.
St Lucia Holidays
St Lucia holidays offer something for everyone. Enjoyed by families and young couples alike, St Lucia is a great destination. See online!
Cheap Holidays
Hunting for cheap holidays? Well save time by booking online with ulookubook.com and you can even check out our top tips to help you hunt down a bargain holiday.
Travel
Before making a choice regarding travel, check out the amazing variety of options on Travel.co.uk.
Cheap holidays in Cyprus
Stunning coastline! Beautiful beaches! Cheap holidays in Cyprus, available at On The Beach.