建立一个BCG的MDI项目,除了一个默认的Toolbar之外,再创建一个Toolbar,也停靠在菜单栏的下面。
可是这样就会造成这两个Toolbar显示都出问题,有时候看不到任何按钮,有时候能看见几个。而且停靠的位置也很混乱!
希望高手帮忙!!!

解决方案 »

  1.   

    你试试把
    HKEY_CURRENT_USER\Software\BCG AppWizard-Generated Applications下的东西删除了
      

  2.   

    BCG什么版本的?我怎么没有遇到过呢?
      

  3.   

    看看你是不是要这里的停靠效果
    http://www.codeproject.com/docking/toolbar_docking.asp
      

  4.   

    我用了,没有发现问题啊?我同时显示3个toolbars,你怎么做的?
      

  5.   

    to楼上的:我把注册表里头的东西都清掉。
    显示3个toolbar的时候,第一次运行3个toolbar没有横向排列在第一行上面,而是一行一个toolbar。关掉程序第二次运行的时候,又在同一行了。
    感觉多个toolbar的排列有问题。能不能指定放在同一行上或者不同行上?
      

  6.   

    使用BCG后,toolbar,menu等如果项目有改变,必须清理注册表。
      

  7.   

    DockControlBarLeftOf(&m_wndToolbar1,&m_wndToolBar);
      

  8.   

    呵呵,我遇到过这样的情况,已经解决了
    第一个toolbar用CreateEx建立
    第二个toolbar用Create建立
    要不然,清理注册表是没用的,
    想当初为这个郁闷死了,该死的BCG
      

  9.   

    每个toolbar 必须有自己唯一的id:错误代码:
    每个toolbar 得ID都是AFX_IDW_TOOLBAR 
    void CMainFrame::OnCreate (LPCREATESTRUCT lpCreateStruct)
    {
        ....
        m_wndToolBar.Create (this, <style>);
        m_wndToolBar2.Create (this, <style>);
        ....
    } 正确代码: 
    void CMainFrame::OnCreate (LPCREATESTRUCT lpCreateStruct)
    {
        ....
        m_wndToolBar.Create (this, <style>);
        m_wndToolBar2.Create (this, <style>, AFX_IDW_TOOLBAR +100);//ID不一样
        ....

      

  10.   

    这是官方原文:
    Q: I create two toolbars in the OnCreate method of my CMainFrame class. When I run the application for the first time, the toolbars show, but when I run a second time, the toolbars are the same and look like the second toolbar. What am I doing wrong?
    A: Be sure that each toolbar is created with its own, unique id:Wrong (each toolbar was created with AFX_IDW_TOOLBAR ID): 
    void CMainFrame::OnCreate (LPCREATESTRUCT lpCreateStruct)
    {
        ....
        m_wndToolBar.Create (this, <style>);
        m_wndToolBar2.Create (this, <style>);
        ....
    } Correct: 
    void CMainFrame::OnCreate (LPCREATESTRUCT lpCreateStruct)
    {
        ....
        m_wndToolBar.Create (this, <style>);
        m_wndToolBar2.Create (this, <style>, id_of_second_toolbar);
        ....

      

  11.   

    常回碰到的FAQ
    http://www.bcgsoft.com/faq.htm#Q10
      

  12.   

    bcg是一个做界面的库,网上搜索一下就知道了
      

  13.   

    太谢谢各位了!这个bug真恶心,让我郁闷了好长时间!