对话框建立类时使用CDialogBar基类时对话框中的按钮都高成了灰色禁用状态,这是为什么请大家指点?

解决方案 »

  1.   

    要设置命令路由:
    BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (m_DlgBar.OnCmdMsg(nID,nCode,pExtra,pHandlerInfo))
    return TRUE;
    }
      

  2.   

    BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (m_DlgBar.OnCmdMsg(nID,nCode,pExtra,pHandlerInfo))
    return TRUE;
      

  3.   

    BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (m_DlgBar.OnCmdMsg(nID,nCode,pExtra,pHandlerInfo))
    return TRUE;
      

  4.   

    还是老样子呀,CDialogBar上的按钮还是灰色
      

  5.   

    msdn有例子,你找一下演示dialogbar用法的例子。