Prevent right-click or hide items in legend

Skip to first unread message

Joshua B. Helm

Jan 15, 2002, 3:37:50 PM1/15/02
We're developing a module for our application suite that uses the MapPoint
2002 ActiveX control 9.0. I'd like to display the overview image and legend
items for the user, but I don't want to allow them to use the built-in
pushpin management functionality they can access from the Pushpins sections
by right-clicking. I'd either like to replace the popup menu with our own,
or remove (hide) the Pushpins section all together.

The BeforeClick event only seems to fire for the map area itself and not in
the legend area. Is there any way to trap these clicks or to hide the
Pushpins section?


- Joshua B. Helm
Technology Manager
Millbrook Incorporated

Walt Cygan

Jan 15, 2002, 4:30:23 PM1/15/02
Check out the PaneState property of the control. You can set this to
"geoPaneNone" to suppress display of the legend.

Also, You cannot create your own popup meny on right-click.


"Joshua B. Helm" <> wrote in message

Chris Gebhardt

Jan 21, 2002, 11:47:21 AM1/21/02
You can replace the default MapPoint right click menu with code:

Private Sub MPC1_BeforeClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)
If Button = 2 Then PopupMenu mnuTest1
End Sub

where mnuTest1 is your own menu. This example is for MP2k2.

Yes, you can hide the legend through the PaneState property, but that also takes away your overview map. To get around this, I
would add two instances of the MPC to the form. If the user clicks on the smaller overview MPC, it would update the larger MPC.
Tedious, but it accomplishes exactly what you want...

Chris Gebhardt, Microsoft MVP
Crime Analysis Associates

"Joshua B. Helm" <> wrote in message news:#$fMCSgnBHA.1516@tkmsftngp07...

Chris Jensen

Jan 22, 2002, 10:22:43 AM1/22/02
Walt & Chris,

Great answers. Thanks for helping the community.
Chris Jensen

This posting is provided “AS IS” with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit

Reply all
Reply to author
0 new messages