PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CToolBarCtrl::EnableButton ??

Does this actually work ??

MyToolBar->EnableButton(ID_DELETE,false);

does absolutely nothing, the return code is successful
but my delete button is not disabled.

If I use

MyToolBar->SetState(ID_DELETE,TBSTATE_INDETERMINATE);

it disables the button but also set the background to white, not what I really require !

Any advice ?
It looks like your are using MFC. In that case you can add an OnUpdateUI command handler for that command ID. You can then use pCmdUI->Enable to enable / disable the button in the handler function. Otherwise the MFC framework will keep enabling the control for you as long as you have a command handler for that command ID. You can just create an empty OnUpdateUI handler for the command and not call the base class implementation if you want to explicitly set the button state elsewhere in your app.

Dan East