如何在程序一开始就使工具条纵向靠左显示
编号:QA002623
建立日期: 2000年2月26日 最后修改日期:2000年2月26日
所属类别:
杨武洋:
操作系统:WIN
编程工具:vc
问题:我用MFC生成的单文档应用程序已编好。其可以显示工具条,但是要使工具条纵向(竖着)显示,得先双击工具条,然后把其拉到左边。请问:如何在程序一开始就使工具条纵向靠左显示?
回答:
把CMainFrame::OnCreate中最后一句DockControlBar(&m_wndToolBar)改为
DockControlBar(&m_wndToolBar,nDockBarID);nDockBarID可为:
AFX_IDW_DOCKBAR_TOP Dock to the top side of the frame window.
AFX_IDW_DOCKBAR_BOTTOM Dock to the bottom side of the frame window.
AFX_IDW_DOCKBAR_LEFT Dock to the left side of the frame window.
AFX_IDW_DOCKBAR_RIGHT Dock to the right side of the frame window.
廖胜天的意见:
可以用下列代码:
DockControlBar( &m_wndMyToolBar, AFX_IDW_DOCKBAR_LEFT );
如果要永久的不让工具条在上方,可以在主窗口中用:
EnableDocking( CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT | CBRS_ALIGH_BOTTOM );
此问题由刘映虹等回答。
| |
|
|
| |
|
|