Click here to Skip to main content
13,143,774 members (30,282 online)
Click here to Skip to main content
Add your own
alternative version


18 bookmarked
Posted 16 Mar 2003

Multiple Toolbars in the PocketPC 2002

, 16 Mar 2003
Rate this:
Please Sign up or sign in to vote.
Handling multiple toolbars - Pocket Word-style.

Sample Image - CeMultiBar.jpg


This article presents a solution on how to implement multiple toolbars in a PocketPC 2002 application. The idea came from an exchange in the Embedded/Mobile message board where this functionality was sought, especially the Pocket Word-like management of the toolbar (


The demonstration project (illustrated above) has two toolbars that are hidden or shown through commands in the main command bar. Note: the demo project is meant to illustrate the working of the toolbars, so no functionality has been implemented on them.

Both toolbars are created in CMainFrame::OnCreate without the WS_VISIBLE style. When the user issues a command to show a toolbar, the window is shown and RecalcLayout is used to reposition everything inside the frame.

void CMainFrame::OnToolbarFormat() 
    CToolBarCtrl& rToolBar = m_wndCommandBar.GetToolBarCtrl();

    m_bFormat = !m_bFormat;

    m_wndFormat.ShowWindow(m_bFormat ? SW_SHOW : SW_HIDE);

    rToolBar.CheckButton(ID_TOOLBAR2, m_bFormat);

Note that there are no ON_UPDATE_COMMAND_UI handlers in the demo. Checking and unchecking of the main command bar buttons is done explicitly in this message handler.

A final note on CToolBar: I found no proper way to have it draw the top border, so I derived the dummy class CCeToolBar with the single purpose of drawing the top border. If there is a better way to achieve this, please post it here.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

João Paulo Figueira
Software Developer (Senior) Frotcom International
Portugal Portugal
I work on R&D for Frotcom International, a company that develops web-based fleet management solutions.

You may also be interested in...


Comments and Discussions

GeneralUsar com o eVB Pin
memberJOSE ROBERTO SIQUEIRA17-Aug-04 2:35 
GeneralRe: Usar com o eVB Pin
João Paulo Figueira17-Aug-04 3:09
memberJoão Paulo Figueira17-Aug-04 3:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170915.1 | Last Updated 17 Mar 2003
Article Copyright 2003 by João Paulo Figueira
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid