CToolbar
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
Hi i am using a toolbar in a PropertyPage as part of a wizard This works fine the first time, but if i access the wizard again, and that particular page then the toolbar fails to load Can anyone help im using the below code
if(!m_toolBar3.CreateEx(this, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_TOOLTIPS |CBRS_FLYBY | TBBS_BUTTON) || !m_toolBar3.LoadToolBar(IDR_TOOLBAR1))
AfxMessageBox("failed");// a small gap between buttons m\_toolBar3.SetButtonInfo(m\_toolBar3.CommandToIndex(ID\_FILE\_SAVE)+1,ID\_SEPARATOR,TBBS\_SEPARATOR,5); m\_toolBar3.SetButtonInfo(m\_toolBar3.CommandToIndex(ID\_EDIT\_DELETE)+1,ID\_SEPARATOR,TBBS\_SEPARATOR,5); m\_toolBar3.SetButtonInfo(m\_toolBar3.CommandToIndex(ID\_EDIT\_UNDO)+1,ID\_SEPARATOR,TBBS\_SEPARATOR,5); m\_toolBar3.SetButtonInfo(m\_toolBar3.CommandToIndex(ID\_APP\_ABOUT)+1,ID\_SEPARATOR,TBBS\_SEPARATOR,5); m\_toolBar3.SetButtonInfo(m\_toolBar3.CommandToIndex(ID\_COLOUR)+1,ID\_SEPARATOR,TBBS\_SEPARATOR,5); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_BOLD),TBBS\_CHECKBOX); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_UNDERLINE),TBBS\_CHECKBOX); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_ITALIC),TBBS\_CHECKBOX); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_PARAGRAPH\_LEFT),TBBS\_CHECKGROUP); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_PARAGRAPH\_CENTER),TBBS\_CHECKGROUP); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_PARAGRAPH\_RIGHT),TBBS\_CHECKGROUP); m\_toolBar3.SetButtonStyle(m\_toolBar3.CommandToIndex(ID\_PARAGRAPH\_BULLETED),TBBS\_CHECKBOX); RepositionBars(AFX\_IDW\_CONTROLBAR\_FIRST, AFX\_IDW\_CONTROLBAR\_LAST,0); m\_toolBar3.MoveWindow( 18, 134,450, 30, 1 );
thanks Simon