CCeCommandBar Question

Hi,

I am currently creating a simple Pocket PC 2002 application using Microsoft eMbedded Visual C++ 3.0. I have a menu and beside it a small toolbar (2 buttons) like this:

File [ ] [ ]

I have the menu and toolbar working fine, when the user clicks on them they perform their task(s); however I cannot work out how to check the toolbar buttons. I need to be able to toggle the state of the buttons between checked and unchecked; I tried mapping to the ON_UPDATE_COMMAND_UI message but it does not seem to make any difference at all.

Any help would be greatly appreciated!

Best Regards,
Lea Hayes
[644 byte] By [lhayes00] at [2007-11-19 1:55:27]
# 1 Re: CCeCommandBar Question
Hi,

I found out the solution to my problem; just in case any of you are having the same trouble here is how to check/uncheck buttons within the toolbar:

// In my toolbar I have a button defined by ID_MYBUTTON

// Check the button:
m_wndCommandBar.GetToolBarCtrl().CheckButton(ID_MYBUTTON, TRUE);

// Uncheck the button:
m_wndCommandBar.GetToolBarCtrl().CheckButton(ID_MYBUTTON, FALSE);

// This also checks the button:
m_wndCommandBar.GetToolBarCtrl().CheckButton(ID_MYBUTTON);

Best Regards,
Lea Hayes
lhayes00 at 2007-11-9 12:38:35 >