昨天看了看MSDN,有一个CMiniFrameWnd类,ControlBar要以这个类作为容器。 MSDN说明如下: A CMiniFrameWnd object represents a half-height frame window typically seen around floating toolbars. These mini-frame windows behave like normal frame windows, except that they do not have minimize/maximize buttons or menus and you only have to single-click on the system menu to dismiss them.
在视类中声明
CDialogBar m_DlgBar;
CMyTab m_TabCtrl; //CMyTab从CTabCtrl继承在类实现中
void CTestvwView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
if (!m_DlgBar.Create(this, IDD_DLG_BAR,
CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_HIDE_INPLACE,
ID_VIEW_TAB_BAR)) //ID_VIEW_TAB_BAR是菜单命令ID,用于显示或隐藏对话框条
{
TRACE0("Failed to create dialog bar m_wndDialogbar\n");
return -1; // fail to create
}
//m_wndTabBar.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT);
//EnableDocking(CBRS_ALIGN_ANY);
//DockControlBar(&m_wndTabBar);
//将m_MyTab与控件IDC_TAB绑定
m_TabCtrl.SubclassDlgItem(IDC_TAB, &m_DlgBar);
return 0;
}
我在MainFrame中实验过,的确可以,但在视中不行
我上面说的方法可以实现,给个email地址,给你代码。
你的方法的确可以实现,类似的代码我已经有了,再次感谢
我是想大家讨论一下为什么在视中就不能实现,MainFrame和VIEW在这方面的差别在哪里
MSDN说明如下:
A CMiniFrameWnd object represents a half-height frame window typically seen around floating toolbars. These mini-frame windows behave like normal frame windows, except that they do not have minimize/maximize buttons or menus and you only have to single-click on the system menu to dismiss them.