共用方式為


Updating User-Interface Objects

You’ll often change the condition of menu items in your running application to provide the user with information about current program conditions. For example, you might want certain menu items to appear grayed to show they’re unavailable. You might want other menu items to have a check mark toggle. The same general idea holds true for toolbar buttons: You can specify that they appear enabled, disabled, or perhaps pushed in, as conditions in the program change. The framework provides a direct, command-based way to set the state of the menus and toolbar buttons.

Suggested Reading in the Visual C++ Programmer’s Guide

Follow the procedures in the topics listed below to learn how to change menu items to match their corresponding commands' states.