Method: Item for MenuPoints
- 更新日2024-09-12
- 3分で読める
Context Menu Object > Methods > Method: Item for MenuPoints
Method: Item for MenuPoints
Returns the context menu item for a certain index.
Set oMenuPoint = Object.Item(Index)
| Object | MenuPoints Object with this method |
| Index | LongInteger Specifies the index of the context menu item. |
| oMenuPoint | MenuPoint Returned object |
| Note To test the following example script, you must first save the script and register the script as a user command in the dialog box that opens when you select Settings»Extensions»User Commands. |
The following example disables all entries in the context menu:
'--- For DIAdem-NAVIGATOR ------------------------------------------ Call AddUserCommandToEvent("Navigator.Events.OnShowingContextMenu","MyNavigatorOnShowingContextMenu") Sub MyNavigatorOnShowingContextMenu(ParentObj, MenuPoints) Dim Index For Index = 1 To MenuPoints.Count MenuPoints.Item(Index).Enable(False) Next End Sub '--- For DIAdem-VIEW ------------------------------------------ Call AddUserCommandToEvent("View.Events.OnShowingContextMenu","MyViewOnShowingContextMenu") Sub MyViewOnShowingContextMenu(Area, MenuPoints) Dim Index For Index = 1 To MenuPoints.Count MenuPoints.Item(Index).Enable(False) Next End Sub