We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Context Menu and Mouse Position

Thread ID:

Created:

Updated:

Platform:

Replies:

12648 Apr 6,2004 03:49 PM UTC Apr 15,2004 05:19 PM UTC WinForms 9
loading
Tags: Tools
Administrator [Syncfusion]
Asked On April 6, 2004 03:49 PM UTC

I am trying to setup the Context Menu such that it is "tweaked" just before it is displayed based on where the mouse click event happened. However the popup event doesn''t give the mouse position??

Administrator [Syncfusion]
Replied On April 6, 2004 09:59 PM UTC

Hi, You would have to derive from our PopupMenu class and override the ShowChildrenUI method. public virtual IPopupChild ShowChildrenUI(Point pos, IPopupParent parentUI) { } Within the ShowChildrenUI method''s argument list you could specify the custom position where you wish to display the PopupMenu. Please try this and let me know if you need further assistance. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 6, 2004 10:31 PM UTC

hmm We what I want to do to is not display the menu at a pt. But rather findout the pt it is displayed at? Make sense? This way if the context menu happens over the column headers I can tweak the menu differently than if it comes up over a cell.. So basically what I want is to findout if you are able to detect the pt the the context menu is being displayed at.

Administrator [Syncfusion]
Replied On April 7, 2004 03:54 PM UTC

Hi, Thanks for the update. I now understand your requirements better. For this purpose, you have to handle the PopupMenu.ParentBarItem''s BeforePopup event and within that event handler ger the Point at which it was invoked using Control.MousePosition property. Based on this Point value, you could then display the desired PopupMenu. Please refer to the sample_attached which shows how this can be done. Try this sample and let me know if it meets your requirements. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 8, 2004 10:28 AM UTC

Ok, this is very close. However, the problem is that this sample rely''s on Control.Mouseposition which isn''t always correct. Technically if a user invokes the Contextmenu from the "keyboard", the menu display point will be the cursor position (if it is a text editing program) or the top-left (if a generic usercontrol) not the mouse position.. This is why I expected the pt to come through on the event args (as they do in win32 on the lParam for WM_CONTEXTMENU) Other ideas? I override the wndproc and crack the WM_CONTEXTMENU message, however this seems like a very common problem that I would think has already been adressed? Comments?

Administrator [Syncfusion]
Replied On April 8, 2004 11:21 PM UTC

Hi, Thanks for the update. I have requested the folks at the development team for their inputs on this, and will update you as soon as I hear from them. We appreciate your patience and cooperation. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 11, 2004 08:44 AM UTC

Hi, ''Shift + F10'' is the ''PopupMenu display key'' and hitting that will show the PopupMenu on the currently active control. If you wish to display the PopupMenu in response to some other key stroke, then you would have to invoke PopupMenu''s Show method at the desired position (for example : the cursor position in a text editor), in the Key Down event handler. Please let me know if this works for you. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 12, 2004 12:42 PM UTC

This doesn''t help at all.. I want to know "the pt that the contextmenu is invoked at" Reread this post.. Ok, this is very close. However, the problem is that this sample rely''''s on Control.Mouseposition which isn''''t always correct. Technically if a user invokes the Contextmenu from the "keyboard", the menu display point will be the cursor position (if it is a text editing program) or the top-left (if a generic usercontrol) not the mouse position.. This is why I expected the pt to come through on the event args (as they do in win32 on the lParam for WM_CONTEXTMENU) Other ideas? I override the wndproc and crack the WM_CONTEXTMENU message, however this seems like a very common problem that I would think has already been adressed?

Administrator [Syncfusion]
Replied On April 13, 2004 01:01 AM UTC

Hi, Thanks for the update. I have consulted the development team in this regard, and will update you with more information as soon as possible. We appreciate your patience and cooperation. Regards, Guru Patwal Syncfusion, Inc.

Administrator [Syncfusion]
Replied On April 15, 2004 05:19 PM UTC

Hi A new PopupMenu.BeforePopup event has been added internally to provide the mouse position where the context menu will be shown. This feature will be available in the next release of Essential Suite (post v2.0.3.0 releases). We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;