MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Custom context menu

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-10-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Custom context menu

I'm asking here after searching this forum and googling for hours - I thought I'd find an answer but no joy so far.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 09-10-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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);
}
Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 09-10-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I'm also interested in a custom properties menu -- anybody have any idea on this?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 09-10-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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);
			}
		}
I hope something like that will work. Not sure about the so-called "Dreaded Server is Busy" business, looks like I need to set a timer to dispose of the context menu. Heck if I know

Mike
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
context, custom, menu


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
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
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


All times are GMT -5. The time now is 07:32 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52