Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 8 of 8

Un-cooperative Popup

This is a discussion on Un-cooperative Popup within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi Firstly my apologies, this is the second posting on this issue, I need to get to the bottom of ...

  1. #1
    JoeBo is offline Member Yellow Belt
    Join Date
    May 2007
    Posts
    31

    Unhappy Un-cooperative Popup

    Hi

    Firstly my apologies, this is the second posting on this issue, I need to get to the bottom of this. I am using visual studio 2005 (vb.net) to control a mappoint 2004 activex control. When the user clicks a position the map a pushpin is added and the latitude/longitude is placed onto a record. This works really well until the user clicks on a location where there is underlying information, this causes mappoint to pop a dialog with the location information. The suggested fix is to cancel the pop up on the beforedouble click event on the active x control I have attempted to do this with no success. I have included the opening lines of the code below; can anyone give me the definitive answer to this problem?

    Any help appreciated
    Joe


    Code:

    Private Sub AxMappointControl1_BeforeDblClick(ByVal sender As System.Object, ByVal e As AxMapPoint._IMappointCtrlEvents_BeforeDblClickEven t) Handles AxMappointControl1.BeforeDblClick

    Try
    e.cancel = True ‘should I be sending cancel some other way
    Dim objMap As MapPoint.Map
    objMap = Me.AxMappointControl1.ActiveMap
    Dim objDataSet As MapPoint.DataSet
    Dim txt1, txt2, txt0, txt4 As String
    Dim Ilat, Ilong As Double
    Dim objResult As Object
    Dim objResults As MapPoint.FindResults

    objResults = objMap.ObjectsFromPoint(e.x, e.y)

  2. #2
    JoeBo is offline Member Yellow Belt
    Join Date
    May 2007
    Posts
    31

    Re: Un-cooperative Popup

    Hi

    Doesn’t look as though I am getting anywhere with this, I will try and elaborate.
    The information I have been able to find on the mappoint support sites suggest that to cancel the popup menu when the active map is double clicked you should use cancle in the before double click event, in looks as though the way the event is called has altered in vb.net from:

    Private Sub AxMappointControl1_BeforeDblClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

    To:

    Private Sub AxMappointControl1_BeforeDblClick(ByVal sender As System.Object, ByVal e As AxMapPoint._IMappointCtrlEvents_BeforeDblClickEven t) Handles AxMappointControl1.BeforeDblClick

    In the mappoint section on msdn it suggests that you can cancel the event by setting cancel = true. In the newer version the equivalent (as I read it) would be to set e.cancel = true. But this doe’s not cancel the event????

    Regards,
    Joe

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Un-cooperative Popup

    Hi,

    you are correct about e.cancel = true; But I think you want to use the BeforeClick instead fo the BeforeDblClick event.

  4. #4
    JoeBo is offline Member Yellow Belt
    Join Date
    May 2007
    Posts
    31

    Re: Un-cooperative Popup

    Hi wilfred

    Thanks for your post, you are correct, I added the cancel event to the before click event and this corrected the problem, it also created another, I want my user to be able to scroll on the map but these controls are canceled at he same time as the popup! Am I correct in assuming that their is no work around to this apart from providing the controls elsewhere.

    Regards,
    Joe

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Un-cooperative Popup

    Hi,

    you mean by scroll the 'pan' map when the white arrows are visible if mouse pointer is near the edges ?

    if yes many things you can do I think, I should solve it by putting 4 transparent panels on the map and handle the panning of the map from there. You can give a custom cursor to each panel, also for the directions NE, NW, etc you can change cursor.

    If you want the user to be not able to do any control on the map (unless the pan) you can put a large transparent panel on the map. This will then intercept not only mouse clicks but also keyboard. Then you have it all in control.

  6. #6
    JoeBo is offline Member Yellow Belt
    Join Date
    May 2007
    Posts
    31

    Re: Un-cooperative Popup

    Hi Wilfred,

    That sounds exactly what I need to do, one question how do I get the code block to pan the map to repeat whilst the mouse is over the panel?

    For example if I use this:

    Dim objMap As MapPoint.Map
    objMap = Me.AxMappointControl1.ActiveMap
    objMap.Pan(MapPoint.GeoPanCmd.geoNorthEast)

    I get one map movement, how do I get the code to run continueslly.

    Regards,
    Joe

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Un-cooperative Popup

    Hi,

    I use a timer for this. use MouseDown and MouseUp events to enable / disable the timer. Set the interval to 1 millisecond (this will interval exactly one timeslice which is 10 ms on workstation and 20 ms on server OS. Take a panFactor of 0.07 to start. This will be a good start.

    instead of a timer you can also use a custom message handler, but I think a timer is wise to use in this case.

  8. #8
    JoeBo is offline Member Yellow Belt
    Join Date
    May 2007
    Posts
    31

    Re: Un-cooperative Popup

    Hi Wilfred,

    Thanks for the support, I will try out the timer suggestion and let you know who it goe’s.

    Regards,
    Joe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Gaia-3 with Microsoft Virtual Earth Supports NSDI Cooperative Agreement Program
    By VE For Government in forum Bing Maps Blogs & Tweets
    Replies: 0
    Last Post: 10-17-2007, 10:41 AM
  2. Problem using PopUp property in Access Form
    By PMACAFEE in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 11-12-2006, 10:45 PM
  3. Disable Mappoin 2002 PopUp Menu (using Vb.net)
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-19-2003, 10:12 AM
  4. Is there any way to disable Mappoint 2002 popup menu?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-12-2002, 06:21 PM
  5. 7/25/01 Ed: How does one inhibit the popup save ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-30-2001, 07:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96