Community of VE/MapPoint Users and Developers
This is a discussion on Displaying context menu on right click of pushpin within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I have 50 pushpins and on right click of each pushpin, I want to display the context menu and ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Re: Displaying context menu on right click of pushpin
Hi, Write an event handler for BeforeClick event. There you check if a pushpin is selected and if right mouse button is clicked. If both are true you set the Cancel argument to true to disable mappoint popup menu and you can popup your own. To popup your own it is best to do this outside the event because if user does not click the menu for more than 10 seconds, the 'Server Busy' dialog will show. To display it outside the event handler you can post a message to a custom message handler.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Displaying context menu on right click of pushpin
Hi Wilfried, Thanks for the reply . My problem is that I am displaying pushpin on beforeDbl_Click event and In this event I am writing the below code Location ObjLocation = MPC.ActiveMap.XYToLocation(e.x, e.y); Pushpin ObjPushpin=MPC.ActiveMap.AddPushpin(ObjLocation, "TACK"); ObjPushpin.Symbol = 32; ObjPushpin.Select(); In SelectionChange_event I am writing Pushpin ObjPrevPushpin = e.pOldSelection as MapPoint.Pushpin; Pushpin ObjCurrPushpin = e.pNewSelection as MapPoint.Pushpin; if (ObjCurrPushpin != null) { General.ObjSelectPushpin = e.pNewSelection as MapPoint.Pushpin ; //public variable } In Before_Click event I am writing if (e.button == 2 && (MPC.ActiveMap.Selection.GetType() == typeof(MapPoint.Pushpin))) { ctmsZoneDefinition.Show(MousePosition);//Context menu strip } but MPC.ActiveMap.Selection.GetType() is returnig ComObject. So I am unable check the pushpin. Please help me |
| |||
| Re: Displaying context menu on right click of pushpin
Hi, You have to change this to: Code: Pushpin pp = MPC.ActiveMap.Selection as Pushpin;
if (e.button == 2 && pp != null) {
ctmsZoneDefinition.Show(MousePosition); // Context menu strip
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| click, context, displaying, menu, pushpin |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 06-10-2008 07:41 AM | |
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 03:33 PM |
| By Right-click displaying context menu on map | Banu | MapPoint 2006/2009 Discussion | 19 | 10-16-2007 08:46 AM |
| Disable Context menu | Anonymous | MapPoint 2006/2009 Discussion | 10 | 05-27-2005 02:03 PM |
| Custom context menu | Anonymous | MapPoint 2006/2009 Discussion | 3 | 09-10-2004 11:15 PM |
| VB.NET & overriding the map point context menu... | Anonymous | MapPoint 2006/2009 Discussion | 0 | 09-05-2002 09:25 AM |