-
toolbar in dialog
I've made a program with MFC in visual C++ 6. then I tried to insert a toolbar. I've made one, IDC_TOOLBAR1. then I tried this code to place it in the dialog:
[code]
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
But when I run this code, I dont get a toolbar. what's wrong, or can anybody give me a little code example (if possible)?
thanks in advance
VIsualPenguin
-
This is strange, that's exactly the code the wizard creates. Try adding the part about docking, maybe the bar isn't displayed otherwise.
-
not when I create a dialog based application.
-
Or try adding a call to CFrameWnd::ShowControlBar
-
It's dialog based? That makes it more complicated. MFC is more a hindrance than a help when you're trying to do things that were not planned.
Try using CToolBarCtrl instead of CToolBar