Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Activate menu on CExtBarButton split-button programmatically Collapse All
Subject Author Date
Neville Franks Aug 24, 2007 - 2:44 AM

I have a split toolbar button with a menu attached to the drop-down arrow. I want to activate & display this menu from my code. All I’ve found so far is CExtBarButton::OnClick() which I assume I can call if I work out what the button rect is. Or is there some better way?

Alternatively is there a way to get the toolbar button menu to activate when the user presses some key?

Thanks,
Neville

Neville Franks Aug 24, 2007 - 6:28 AM

Thanks Suhai, that seems to work perfectly.

Neville, http://www.surfulater.com

Suhai Gyorgy Aug 24, 2007 - 6:13 AM

It seems like all you need to call is m_wndToolBar.TrackButtonMenu(uIndexOfYourButton);
I’ve tried it in ProfUIS_Controls sample, in PageToolBars class. In the handler of one of the central checkboxes, I put the line m_wndToolBarColor.TrackButtonMenu(0); and it worked fine. There are 3 more parameters of this method, but I’m not sure what they mean, it seems their default values are good enough.