Board index » Visual Studio » dynamic toolbars
|
johns1111
|
dynamic toolbars
Visual Studio365
Hi, I made one application which initially has only onr button on the toolbar. When you click on that button the function is called having the code.. m_wndToolBar.SetButtons(NULL, 3); m_wndToolBar.SetButtonInfo(0, ID_APP_ABOUT, TBBS_BUTTON, 7); m_wndToolBar.SetButtonInfo(1, ID_FILE_NEW, TBBS_BUTTON, 0); m_wndToolBar.SetButtonInfo(2, ID_EDIT_CUT, TBBS_BUTTON, 3); m_wndToolBar.Invalidate(); But still i can see only on button on the toolbar. when i resize the window then i got to see the toolbar with 3 bottons. what is the reason? I am able to solve the problem by adding one line at the end of above mention code m_wndToolBar.SetButtons(NULL, 3); m_wndToolBar.SetButtonInfo(0, ID_APP_ABOUT, TBBS_BUTTON, 7); m_wndToolBar.SetButtonInfo(1, ID_FILE_NEW, TBBS_BUTTON, 0); m_wndToolBar.SetButtonInfo(2, ID_EDIT_CUT, TBBS_BUTTON, 3); m_wndToolBar.Invalidate(); SendMessage(WM_SIZE); // <----------- is this the best way ? what is the best way to create dynamic toolbars. thanks dev - |
