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

Click events of context menu are not firing....

This is a discussion on Click events of context menu are not firing.... within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi There, First keep the following parameters in mind to understand my problem: Application : C#.NET Framework: .NET 1.1 MapPoint: ...

  1. #1
    Learner is offline Junior Member Yellow Belt
    Join Date
    Feb 2006
    Posts
    18

    Click events of context menu are not firing....

    Hi There,
    First keep the following parameters in mind to understand my problem:
    Application : C#.NET
    Framework: .NET 1.1
    MapPoint: MapPoint2004 Europe

    Scenario:
    I've made a user control on which I've placed the ActiveX control of mappoint. The control will be used in another form. I've attached a context menu to mappoint control in User control. The context menu is displaying accurately by passing the default context menus.
    Problem:
    The problem is that when I click on any menu option, the click event is not fired but if I try Select event it works just fine. I don't know what is going wrong? Can anyone help me please?
    Thanks in advance
    Regards
    Learn from cradle to the grave

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

    Sorry I dont understeand what you try to say. Can you enlighten more ?

  3. #3
    Learner is offline Junior Member Yellow Belt
    Join Date
    Feb 2006
    Posts
    18

    Here am i with more elaboration on the issue

    Hi Wilfried,
    Well I thought that I've already made an elaborated description of my problem but your answer suggest me some different opinion. Anyway, let me give it another try to explain it a bit more.
    So here is the series of action in my application:

    • First of all I've made a window's user control.
      Then I placed an ActiveX mapPoint Control on it.
      Then I attached a context menu with this control.
      Then I inserted different options in context menu.


    Now I created another form.
    Placed my user control on it.
    When I run the application and load that form, it loads map on it at runtime. When I right click on it then my own context menu appears as I intend to do by passing the default one.
    But when I click on any context menu option, the click event is not fired. If instead of click event, I register Select event then it works but since it is fired whenever mouse comes over any option hence its not what I'm looking for.
    I think its clear now though it has got heavier in terms of text....
    Thanks in advance
    Regards
    Learn from cradle to the grave

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

    Thanks for detailed explanation. If I read now again your first one it is also very clear, but it was not for me

    I never used a user control, but I assume there is some bug here and there because you try probably an untested situation. I think it is best to place the MP control on a form with his context menu to avoid problems.

    Sorry, I know this does not answer your question direcly, but doing so you are also rid of the problem.

  5. #5
    Learner is offline Junior Member Yellow Belt
    Join Date
    Feb 2006
    Posts
    18

    Click events of context menu are not firing....

    Hi Wilfried,
    Thanks for your proposed solution but it still does not work. Though my requirement is to use user control to do all that business but to analyze the problem I tested your proposed solution. I created a form and place an ActiveX map control on it. Then in BeforeClick event I cancelled the default menus and showed my own menu in MouseDown event. The context menu is appearing fine but when I clicked on any of menu option, no click event is firing. I've seen discussion that e.Cancel = true also cancels the events so is it the same problem here? If yes how to tackle it and if no then what can be the reason for it. Anyone proposing a solution is highly appreciated please.
    Regards
    Learn from cradle to the grave

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

    I just did following test:

    MP ActiveX on a main form
    Context menu named PopupMenu with 1 item and a Click event with:
    Code:
    Console.Beep();
    then in BeforeClick:

    Code:
            private void MP_BeforeClick_1(object sender, AxMapPoint._IMappointCtrlEvents_BeforeClickEvent e)
            {
                e.cancel = true;
                PopupMenu.Show(MousePosition);
    When I click right the Popup menu is showed, and when Iclick the item the speaker does a happy beep

    I use VS2005 and dotNet version 2.

  7. #7
    mhuslig is offline Junior Member White Belt
    Join Date
    Apr 2006
    Posts
    2

    Re: Click events of context menu are not firing....

    My context menu, called by a timer as suggested, wasn't firing either until I changed the

    contextMenu1->Show(axMappointControl1,Point(clickX,clickY))

    to

    contextMenu1->Show(this,Point(clickX,clickY))

    where this is Form1 or whatever.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Disable Context menu
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 12-23-2008, 01:05 PM
  2. By Right-click displaying context menu on map
    By Banu in forum MapPoint Desktop Discussion
    Replies: 19
    Last Post: 10-16-2007, 08:46 AM
  3. Custom context menu
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-10-2004, 11:15 PM
  4. Extending MapPoint - How about the Context Menu Enhancements
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 02-10-2004, 10:38 AM
  5. VB.NET & overriding the map point context menu...
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 09-05-2002, 09:25 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