'Handle ImageView MouseClick
'When right click open a contextmenu which is assigned to a button.
'The imageview has no contextmenu property - using it from a button is a workaround.
'The button is invisible and its position is the same as the imageview.
'Requires the JavaObject Library.
Sub ImageView1_MouseClicked (EventData As MouseEvent)
If EventData.SecondaryButtonPressed Then
Dim joContextMenu As JavaObject = Button1.ContextMenu
joContextMenu.RunMethod("show", Array(Button1, "RIGHT", 5.0, 10.0))
End If
End Sub