Z
Zebedee6
Guest
Hi
I am trying to create my own toolbar. I have created a toolbar resource. When the program first runs the toolbar shows. If I undock it and click the X to close the toolbar the next time I run the program the toolbar is gone and I can't get it back.
Also if I disable LoadToolbar and run the program the toolbar disappears (naturally) but won't come back when the LoadToolbar is re-activated.
How can I get my toolbar back each time the program is run
Thank you
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
m_MyToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(1,1,1,1), IDR_MYTOOLBAR);
m_MyToolBar.LoadToolBar(IDR_MYTOOLBAR);
m_MyToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_MyToolBar);
Continue reading...
I am trying to create my own toolbar. I have created a toolbar resource. When the program first runs the toolbar shows. If I undock it and click the X to close the toolbar the next time I run the program the toolbar is gone and I can't get it back.
Also if I disable LoadToolbar and run the program the toolbar disappears (naturally) but won't come back when the LoadToolbar is re-activated.
How can I get my toolbar back each time the program is run
Thank you
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWndEx::OnCreate(lpCreateStruct) == -1)
return -1;
m_MyToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(1,1,1,1), IDR_MYTOOLBAR);
m_MyToolBar.LoadToolBar(IDR_MYTOOLBAR);
m_MyToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_MyToolBar);
Continue reading...