The following, inserted in the script for your object, will display a context menu on right mouse click. The "DesktopX" option will allow the default context menu to come up (different depending on the host environment for your object/widget).
Function Object_OnRButtonUp(x,y,dragged)
If Not dragged Then
Dim menu
Set menu = DesktopX.CreatePopupMenu
menu.AppendMenu 0, 1, "Options 1"
menu.AppendMenu 0, 2, "Options 2"
menu.AppendMenu 0, 99, "DesktopX"
Dim rtn
rtn = menu.TrackPopupMenu(0, System.CursorX, System.CursorY)
Select Case rtn
Case 1
'Do something
Case 2
'Do something else
End Select
Set menu = nothing
If rtn <> 99 Then
Object_OnRButtonUp=True
End If
End If
End Function