MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Finding Pushpin Name by clicking on the Pushpin?(MP 2002)

This is a discussion on Finding Pushpin Name by clicking on the Pushpin?(MP 2002) within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am a relatively beginner programmer and would certainly appreciate your help with my problem. I am adding with ...


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 01-06-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 10
Finding Pushpin Name by clicking on the Pushpin?(MP 2002)

Hi,
I am a relatively beginner programmer and would certainly appreciate your help with my problem.
I am adding with the help of a Recordset from an Access database to Mapoint and adding pushpins with names as IDs that I get from the Recordset from Access. So far so good.
What I want to know is can I select the ID or the pushpin name of each individually clicked pushpin? I am doing this in VB6 Thanks.
Nick.
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 01-06-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Nick,

You could put this in a command button.

Code:
Dim objmap As MapPointctl.Map 
Dim objPushpin As MapPointCtl.Pushpin 

Set objmap = MapPointControl1.ActiveMap 
      'Make sure the item selected on the map is a pushpin 
    If TypeOf objmap.Selection Is Pushpin Then 
      Set objPushpin = MapPointControl1.Selection        
      'Do Something 
      msgbox objpushpin.name
    End If
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 01-06-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 10
It Worked!

John, the piece of code worked great. Thanks again.
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 01-10-2003
Junior Member
White Belt
 
Join Date: Dec 2002
Posts: 4
If this is going to be used by other people, you also want to trap the case where there is no selection. If you don't do that, the program will error when you try to ask the typeof nothing.
Try this:
Code:
Dim objmap As MapPointctl.Map 
Dim objPushpin As MapPointCtl.Pushpin 

Set objmap = MapPointControl1.ActiveMap 

'Make sure the item selected on the map is a pushpin 
If Not objmap.Selection is nothing Then
  If TypeOf objmap.Selection Is Pushpin Then 
    Set objPushpin = MapPointControl1.Selection        
    'Do Something 
    msgbox objpushpin.name 
  End If
End If
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-10-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 10
Thanks a lot Sitemark, I had already figured that out but not before encountering the error you talked about. (learning the hard way). But thank you very much for the code as any help is always appreciated.
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
2002, clicking, finding, pushpin, pushpinmp


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
Get PushPin Anonymous MapPoint 2006/2009 Discussion 1 03-03-2005 11:16 AM
automate clicking action zauber MapPoint 2006/2009 Discussion 0 07-10-2004 05:23 AM
Discuss news by clicking New Topic Eric Frost MapPoint 2006/2009 Discussion 1 06-15-2003 09:29 PM
finding a pushpin from a .dll blackmap MapPoint 2006/2009 Discussion 1 01-10-2003 03:11 PM
pushpin Anonymous MapPoint 2006/2009 Discussion 1 08-30-2002 09:41 AM


All times are GMT -5. The time now is 09:47 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


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 53 54 55