不是的在VIEW 中可以执行的,但是在BUTTON上不行,出来的不是灰色的,帮帮忙吧!

解决方案 »

  1.   

    void CButtonEX::OnContextMenu(CWnd* pWnd, CPoint point) 
    {
    //cbuttonex::cbutton
    // TODO: Add your message handler code here
    bIsRButtondown = TRUE;
    // ClientToScreen( &point ) ;
    menu_bar = (BCMenu*)AfxGetMainWnd()->GetMenu();
    file_menu =(BCMenu*)menu_bar->GetSubMenu(4);    
       ASSERT(file_menu);
       TRACE("can go here ?\n");   file_menu->TrackPopupMenu(TPM_RIGHTBUTTON, 
    point.x , point.y , this);
    bIsRButtondown = TRUE;
    // CButton::OnRButtonDown(nFlags, point);
    }
    在VIEW 中定义不变灰,但是在CBUTTONEX中定义变灰,我指的是菜单中的菜单项