I feel like this is a really novice question, but it has been driving me up
the wall and I can't find an example or any fleshed out documentation.
I'm writing an app. that has to dynamicly create buttons on a toolbar that
is contained in a CFormView. I'm using CToolBar::AddButtons().
My problem is that some of the buttons are supposed to be in "groups" (you
click one button, it stayes pressed all the others unpress). I've tried
all sorts of combinations with TBSTYLE_CHECKGROUP but I can't get it to work
properly. Mostly the buttons act kind of like single check buttons, but
won't uncheck. Mostly they just don't work right.
Here is a code snipet. If someone has an idea what I'm doing wrong, please
let me know. This is driving me nuts.
// all dynamic group btns route to the same command handler
// which btn was clicked is determined by calling GetMessagePos
// and HitTest()
I'm using CToolBarCtrl::AddButtons() not CToolBar::AddButtons()
and the call at the end of the code snippet should be
Solved my own problem. If the buttons don't all have unique command Ids, then
the grouping doesn't work right.
"Zack Moore" <email@example.com> wrote:
>I'm using CToolBarCtrl::AddButtons() not CToolBar::AddButtons()
>and the call at the end of the code snippet should be
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL