请问如何控制程序刚开始时,工具条的位置?

解决方案 »

  1.   

    在Frm::OnCreate()中设置工具条的风格,可以参照任何一个单文档程序的Frm::OnCreate().
      

  2.   

    CToolBar::Create
    BOOL Create( CWnd* pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP, UINT nID = AFX_IDW_TOOLBAR );参数
    dwStyleThe toolbar style. Additional toolbar styles supported are: CBRS_TOP   Control bar is at top of the frame window.
    CBRS_BOTTOM   Control bar is at bottom of the frame window.
    CBRS_NOALIGN   Control bar is not repositioned when the parent is resized.
    CBRS_TOOLTIPS   Control bar displays tool tips.
    CBRS_SIZE_DYNAMIC   Control bar is dynamic.
    CBRS_SIZE_FIXED   Control bar is fixed.
    CBRS_FLOATING   Control bar is floating.
    CBRS_FLYBY   Status bar displays information about the button. 
    CBRS_HIDE_INPLACE   Control bar is not displayed to the user.
      

  3.   

    看看你的那个变量 CToolBar    m_wndToolBar;也就是在CMainFrame::OnCreate()
    他使用m_wndToolBar.CreateEx()的时候,风格设置的是什么!换你需要的。比如说CBRS_TOP   
    换成CBRS_BOTTOM  那工具条就到了下面。
      

  4.   

    如果我想要它悬浮出来应该怎么做?CBRS_FLOATING那个参数好象不行,还有左边和右边的参数也没有。
      

  5.   

    参看
    http://www.vckbase.com/document/viewdoc.asp?id=515如何定制浮动工具条
      

  6.   

    在Frm::OnCreate()中使用MoveWindow()方法
      

  7.   

    有了有了:FloatControlBar()函数!例如:
    FloatControlBar(&m_wndToolBar, CPoint(200,300),CBRS_ALIGN_RIGHT);注意这第二个参数,相对的应该是整个屏幕的坐标。