![]() OleMenuCommands and Selection context objects. For more information, see MenuCommands vs. ![]() Commands added to the main menu are immediately available for scripting. Commands in Visual Studio route in a hierarchical manner, starting with the innermost command context, based on the local selection, and proceeding to the outermost context, based on the global selection. In most instances, the IDE handles commands using the IOleCommandTarget interface. The event handler determines when the command is visible or enabled, allows you to modify its text, and ensures that the command responds appropriately ("routes") when activated. When you create a command, you also must create an event handler for it. For more information, see Add a menu controller to a toolbar. A menu controller is a hybrid in which one side of the control is a toolbar button and the other side is a down arrow that displays additional commands when clicked. In a drop-down list control, each item in the list is associated with a different command. Toolbar buttons usually have icons that suggest the underlying commands, such as a printer for a Print command. When you click a toolbar button, its associated command is activated. All toolbar controls are associated with commands. Toolbars typically are rows of buttons and other controls, such as combo boxes, list boxes, text boxes, and menu controllers. For more information, see Extend menus and commands. Some well-known menu names are File, Edit, View, and Window. Commands, when clicked, can carry out tasks or launch submenus that contain additional commands. When clicked, menus expand to display one or more commands. Menus also can be displayed as the result of a right-click event, and are referred to as shortcut menus in that context. Menus typically are displayed as one-word strings clustered in a row at the top of the integrated development environment (IDE) or a tool window. Typically, related commands are clustered together on the same menu or toolbar. Menus and toolbars are convenient graphical ways to present your commands to users. Commands are functions that accomplish tasks, such as printing a document, refreshing a view, or creating a new file. Menus and toolbars are the way users access commands in your VSPackage.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |