INFO: CDialogBar Button Enabled When Command Handler Present

This article was previously published under Q98198
This article has been archived. It is offered "as is" and will no longer be updated.
A button in a CDialogBar object is disabled automatically if the commandrouting does not contain a command handler function for the button.

To enable a button in a CDialogBar object, the command routing must includea command handler for the button. A button command handler can be anON_BN_CLICKED(), ON_COMMAND(), or ON_COMMAND_UI() message handler and itmust appear in the message map of an object in the command routing. If theparent of the CDialogBar object is a CFrameWnd object, then the command ishandled by the active child window or view, by the document attached to theview, by the frame window, and by the application (CWinApp object).

NOTE: Because the CDialogBar object is not included in the routingscheme, the ON_BN_CLICKED() or ON_COMMAND() handler must be placed in oneof the objects mentioned above that is in the routing scheme and not in theCDialogBar class.

For more information on command routing, see the "Command Routing" sectionin Chapter 3 of the "Class Library Reference" manual. In Visual C++ 32-bitEdition, version 4.0, see both the "Command Routing" topic of the"Programming with MFC: Overview" in the Books Online and the MFC TechnicalNote 31, Control Bars.
1.00 1.50 2.00 2.10 2.50 2.51 2.52 3.00 3.10 4.00 enabling disabling kbinf

Article ID: 98198 - Last Review: 10/26/2013 11:50:00 - Revision: 4.0

  • Microsoft Foundation Class Library 4.2
  • kbnosurvey kbarchive kbarchitecture kbdlg kbinfo kbmfcctrlbar KB98198