我想做一个多文档界面,不想要工程自带的菜单和工具栏按钮,怎么才能把他们去掉呢?请各位指点下!

解决方案 »

  1.   

    我不是想修改它们,就是想把他们全去掉,我现在知道怎样把工具栏给去掉了
    就是在int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)中把关于工具栏初始化的的程序给隐掉就可以了,但是现在还不清楚怎样把菜单栏给去掉,也就是程序运行之后看不到菜单栏..
      

  2.   

    CWnd   *pWnd=AfxGetMainWnd();       
     pWnd->SetMenu(NULL);  //隐藏菜单
      

  3.   

    是在int CMainFrame::OnCreate函数中加吗运行的时候怎么会出错呢
      

  4.   

    TO :xyh2007() 这个恩在单文档里可以,我在考虑一下怎么用到多文档里去
      

  5.   


    先屏蔽"工具栏"的有关信息如下
    int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
    {
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
    return -1;

    /* if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
    | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
    !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
    {
    TRACE0("Failed to create toolbar\n");
    return -1;      // fail to create
    }
    */
    if (!m_wndStatusBar.Create(this) ||
    !m_wndStatusBar.SetIndicators(indicators,
      sizeof(indicators)/sizeof(UINT)))
    {
    TRACE0("Failed to create status bar\n");
    return -1;      // fail to create
    } // TODO: Delete these three lines if you don't want the toolbar to
    //  be dockable
    //m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    //EnableDocking(CBRS_ALIGN_ANY);
    //DockControlBar(&m_wndToolBar); return 0;
    }
    然后在用DEL键删除ResouceView中的IDR_MAINFRAME工具档资源
    再自己重建一个TOOLBAR 
    SetMenu(NULL)可以隐藏菜单