Help:如何在View里创建工具栏
lase 2002-07-31 01:12:52 我在一个View的OnCreate函数里这样写
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC,CRect(0,0,0,0), ID_TOOLBAR) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
TBSTYLE_WRAPABLE | CBRS_TOOLTIPS | CBRS_FLYBY);
编译,运行都没出错,就事不显示工具栏.