M-Files UI Extensibility Framework
SetCommandState Method
ICommands Interface : SetCommandState Method
The ID of the target command. The ID can represent a custom or a built-in command. The built-in commands are enumerated in BuiltinCommand.
The location in the user interface. Use CommandLocation_All to to set the state in all locations.
The state to set for the command.
Description
Sets the command to be hidden, visible, enabled, or disabled. This method can have an effect on the context menu (and top pane), menu bar, task area, or all of them.
Syntax
Visual Basic
Public Sub SetCommandState( _
   ByVal command As Long, _
   ByVal location As CommandLocation, _
   ByVal state As CommandState _
) 
Parameters
command
The ID of the target command. The ID can represent a custom or a built-in command. The built-in commands are enumerated in BuiltinCommand.
location
ValueDescription
CommandLocation_AllRefers to all locations.
CommandLocation_ContextMenuRefers to the context menu and the Create button in the top pane.
CommandLocation_MainMenuRefers to the menu bar. Press Alt to show the menu bar in M-Files Desktop.
CommandLocation_TaskPaneRefers to the task area.
CommandLocation_UndefinedUndefined value.
The location in the user interface. Use CommandLocation_All to to set the state in all locations.
state
ValueDescription
CommandState_ActiveThe command is visible and it can be used.
CommandState_HiddenThe command is not visible.
CommandState_InactiveThe command is visible but it cannot be used.
CommandState_UndefinedUndefined value.
The state to set for the command.
Remarks
See Also

ICommands Interface  | ICommands Members