Profile Picture

Right Button pressed in a Shape

Posted By Luis Miguel Perez Lopez 11 Years Ago
Author
Message
Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
I have created an array of Nshapes, and I need to know when a Shape is selected with the right or the left mouse button. I have added this:

AddHandler DrawingView.EventSinkService.NodeSelected, AddressOf EventSinkServiceNodeSelected

This works but ONLY with the LEFT button. When I press the right button in a shape, that event is not fired.

I tried with this another:

AddHandler DrawingView.EventSinkService.NodeMouseDown, AddressOf EventSinkServiceNodeMouseDown

But it doesn't work AT ALL. I was seeing this page :

http://helpdotnetvision.nevron.com/UsersGuide_ConceptualOverview_Diagram_Services.html

But I don't find the solution. Does anybody can help me ?

Nevron Support
Posted 11 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Yesterday @ 8:46 AM
Posts: 3,054, Visits: 4,012

Hi Luis,

Please elaborate what you are trying to achieve? Do you want shape to be selected by clicking on a shape with either the left or the right mouse button, or do you simply want to be notified when a shape is clicked with the left or the right mouse button?



Best Regards,
Nevron Support Team



Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
What I want is when the user press the right button on a shape, a context menu has to be opened.

Charley Lee
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 5, Visits: 1
I was able to get it working using this event handler:

NDrawingDocument.EventSinkService.NodeMouseUp

It has a Button property on the args that tells you which button was pressed on the mouse.

Hope that helps,

Charley


Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
I tried this event handler but I get the same as the other event handler (NodeMouseDown)

Charley Lee
Posted 11 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 5, Visits: 1
Weird, it works for me, although I'm using C#.  I'm using 13.1.7.12 version of Nevron.Diagrams.  What version are you using?

Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
I'm using 9.5.11.12 and visual basic 2005 Team Edition

Luis Miguel Perez Lopez
Posted 11 Years Ago
View Quick Profile
Forum Member

Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)Forum Member (29 reputation)

Group: Forum Members
Last Active: 11 Years Ago
Posts: 29, Visits: 1
I've got it . First I had to add a handler for the drawingview:

AddHandler DrawingView.MouseDown, AddressOf DrawingView_MouseDown

And this is the code for de sub

Private Sub DrawingView_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DrawingView.MouseDown

Dim ActiveShape As Object = DrawingView.LastActiveDocumentContentHit(DrawingView.GetMousePositionInDevice(), -1, Nevron.Diagram.Filters.NFilters.TypeNShape)

Dim XShape As NShape = CType(ActiveShape, NShape)

If e.Button = Windows.Forms.MouseButtons.Right And Not XShape Is Nothing Then

ContextMenuStripTree.Show(DrawingView, CInt(e.X), CInt(e.Y))

End If

End Sub



Similar Topics


Reading This Topic