This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I have added a context menu to the diagram surface. If the user click one menu item, I want to create a node where the context menu pop up. So is there a good way how can I get the coordinates of the context menu. Thanks |
|
|
Hello Jzhou To do this, attach an event handler to the DiagramSurface.ContextMenuOpening event. In the event handler, use the DiagramSurface.GetMousePosition method to get the logical position of the mouse. Store the result in a field or property somewhere. When the menu item is clicked, create a new instance of the node, then set the Bounds property to position the node. You can get the x and y values from the mouse position you stored previously. Jason Fauchelle |
|