MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




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

This is a discussion on Click events of context menu are not firing.... within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-06-2006
Junior Member
Yellow Belt
 
Join Date: Feb 2006
Posts: 18
Send a message via MSN to Learner Send a message via Yahoo to Learner
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
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 03-07-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Hi,

Sorry I dont understeand what you try to say. Can you enlighten more ?
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 03-07-2006
Junior Member
Yellow Belt
 
Join Date: Feb 2006
Posts: 18
Send a message via MSN to Learner Send a message via Yahoo to Learner
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
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 03-08-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
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.
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 03-09-2006
Junior Member
Yellow Belt
 
Join Date: Feb 2006
Posts: 18
Send a message via MSN to Learner Send a message via Yahoo to Learner
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 03-14-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-12-2008
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.
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
click, context, control, event, form, mappoint


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
By Right-click displaying context menu on map Banu MapPoint 2006/2009 Discussion 19 10-16-2007 07:46 AM
Disable Context menu Anonymous MapPoint 2006/2009 Discussion 10 05-27-2005 01:03 PM
Custom context menu Anonymous MapPoint 2006/2009 Discussion 3 09-10-2004 10:15 PM
Extending MapPoint - How about the Context Menu Enhancements Anonymous MapPoint 2006/2009 Discussion 2 02-10-2004 09:38 AM
VB.NET & overriding the map point context menu... Anonymous MapPoint 2006/2009 Discussion 0 09-05-2002 08:25 AM


All times are GMT -5. The time now is 08:11 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

Rome Flights
Rome flights can be costly flights if you don't know where to book. You can find the latest deals from the leading UK Tour Operators at Holiday Hypermarket.

Flights to Spain
Find and book flights to Spain. Travel Counsellors can help with travel to Spain including flights and accommodation.

Cheap Holidays to Turkey
If you’re looking for cheap holidays to Turkey then dealchecker.co.uk is the place for you! Our search helps you see real prices from the UK’s top holiday companies all in one go.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Cheap Spain Holidays
Stay well informed when you are searching for cheap holidays online. For useful advice on when to book cheap Spain holidays make sure you look on ulookubook.com

Travel Deals
Click here and read up on the travel deals available online.

Holidays to Goa
Golden beaches, coconut trees. Visit On The Beach for holidays to Goa, and experience India!


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