Tool Bar

How to delete a button from tool bar after creation
TCNTAsked:
Who is Participating?
 
ZoppoCommented:
Hi TCNT,

assuming your toolbar object is 'm_wndToolBar' and the button you want to delete has ID ID_BUTTON1 you can do:

CToolBarCtrl& toolBarCtrl = m_wndStatusBar.GetToolBarCtrl();
UINT id = toolBarCtrl.CommanToIndex( ID_BUTTON1 );
toolBarCtrl.DeleteButton( id ); // or you can use HideButton()

hope that helps,

ZOPPO
0
 
TCNTAuthor Commented:
This should be the correct line.
CToolBarCtrl& toolBarCtrl = m_wndToolBar.GetToolBarCtrl();
0
 
ZoppoCommented:
uups, sorry and thanx for correction      :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.