View Single Post

  #2 (permalink)  
Old 01-27-2003
jia_1980 jia_1980 is offline
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 6
Hi, I think maybe you can try this sub:
'Map1 is a mappoint control

Private Sub map1_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
Dim xx As Long, yy As Long
'You need check your scalemode property. I am using twip in VB, but mappoint uses pixel.

xx = X / Screen.TwipsPerPixelX
yy = Y / Screen.TwipsPerPixelY


Dim objtemp As MapPoint.FindResults
Set objtemp = objMap.ObjectsFromPoint(X, Y) 'objmap is a mappoint.map object
If TypeOf objtemp.Item(1) Is MapPoint.Pushpin Then
Load Form1 'This is the form you want to show
' Do what you want to do, like "Form1.Label1.Caption = frmSearch.Label1.Caption"
Form1.Show 1
Else
MsgBox "It is not a pushpin"
End If
End Sub

Good luck.
Reply With Quote