Sets or returns the command for this menu item. The Command
object command is always returned, but you can specify either the object or
the command's SIObject.Name as a String.
Once you have associated a command with a menu item, the command will be
called whenever the item is selected. You can attach any native or custom
commands you want to a menu item.
If your menu is attached to a contextual menu and one of your command's arguments
takes selected objects by default, then the currently selected objects are
passed to your command. The target object under the cursor is also passed in as
part of the selected objects. However, if no objects are selected then only the
target is passed in. See ArgumentCollection.AddWithHandler
for defining a custom command's argument that takes the selected objects by default.
When a command is attached to a menu item, the caption is set as follows:
item_name [origin] hotkey
...where 'item_name' = the name of the menu item, 'origin' = the origin of the
command ([u] for user, [w] for workgroup) and 'hotkey' = the hotkey associated
with the command.
The menu item will be greyed out if the command is disabled.
// get accessor Command MenuItem.get_Command(); // set accessor MenuItem.set_Command( Object out_ppCommand ); |