I want to make a button on an MFC tool bar that can be pressed and retain it’s state until pressed again (like a check box) but I don’t want a tick box. I’d ideally like a button that changes between two icons and uses DDV to change the value of a boolean on being pressed. How would I go about this.
As a side question I could really do with a good book on MFC. I’ve got Programming Windows with MFC 2nd edition, but was wondering if there was anything that went into a bit more detail?
Use
ON_UPDATE_COMMAND_UIto set the state of the button. e.g. a typical handler will look like this:With regard to good MFC documentation I recommend Professional MFC (Mike Blaszczak) – it’s a little old but very good.