Hi all,

I have a CMFCToolBar with 2 buttons and I want to disable all the buttons if any of them been clicked

I added the following message map:
ON_COMMAND(ID_TOOLBAR_MY_BUTTON1, CMyView::OnButtonClicked1)
ON_COMMAND(ID_TOOLBAR_MY_BUTTON2, CMyView::OnButtonClicked2)

And in the message handler I'm doing the following:

m_wndToolBar.SetButtonStyle(m_wndToolBar.CommandToIndex(ID_TOOLBAR_MY_BUTTON1), TBBS_DISABLED);

m_wndToolBar.SetButtonStyle(m_wndToolBar.CommandToIndex(ID_TOOLBAR_MY_BUTTON2), TBBS_DISABLED);

Both buttons gets greyed out as required but the one I've clicked on gets enable again when the function returns (the second button remains disabled).

It's almost like the button remembers it's state before the click and no matter what I'll do in the message handler the state before the click will be resotored.

(When I look at the CMFCToolBarButton::m_nStyle value after it's been disabled I can see that it is set to 0x0000000)

Any ideas???