可不可以在基于 Dialog 的工程中,或者是一个Dialog上加入 ToolBar ?

解决方案 »

  1.   

    可以,见下:
    http://www.codeguru.com/dialog/toolbars.shtml
    http://www.codeguru.com/dialog/PlacingAToolbarOnADlg.shtml
    http://www.codeguru.com/dialog/dlgtoolbar.shtml
    http://www.codeguru.com/dialog/tbdlg_ok.shtml
      

  2.   

    BOOL CMyDlg::OnInitDialog() 
    {
    CDialog::OnInitDialog();
        if (!m_ToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
    |CBRS_TOOLTIPS| CBRS_GRIPPER | CBRS_FLYBY |CBRS_BORDER_3D) ||
    !m_ToolBar.LoadToolBar(IDR_DLG_TOOL))
    {
    TRACE0("Failed to create toolbar\n");
    return -1;      // fail to create
    }
    EnableToolTips();//支持工具提示
    RepositionBars(0,0xffff,NULL); return TRUE;  // return TRUE unless you set the focus to a control
                  // EXCEPTION: OCX Property Pages should return FALSE
    }
      

  3.   

    可以,在OnCreate里面建立并且响应就可以了
      

  4.   

    http://www.vckbase.com/vckbase/
    第十一期框架窗口文档与视栏中有源码及说明