Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Toolbar icons not displayed
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar icons not displayed

 Post Reply Post Reply
Author
Message
JerryEvans View Drop Down
Groupie
Groupie
Avatar

Joined: 01 May 2008
Location: United Kingdom
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote JerryEvans Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar icons not displayed
    Posted: 22 May 2008 at 7:51am
I've got a variety of toolbars all of which are based on 32BPP bitmaps. All are created in the same way in the OnCreate() member function of my Frame window. The snap below shows the active undo and find buttons. The 'select view' shows my problem - no bitmap. Any clues to why this is happening?




Here is the code:

CXTPToolBar* pToolBarViews = pCB->Add(_T("Views"), xtpBarTop);
    if (pToolBarViews)
    {
        pToolBarViews->SetBarID(IDR_TOOLBAR_VIEWS);
        CXTPControlPopup* p = (CXTPControlPopup*)
        pToolBarViews->GetControls()->Add(xtpControlButtonPopup,ID_VIEW_SELECT);
        if (p)
        {
            p->SetStyle(xtpButtonCaption);
            p->SetCaption("Select View");
            CMenu menu;
            menu.LoadMenu(IDR_SYSTEM);
            p->SetCommandBar(menu.GetSubMenu(1));
        }
        pToolBarViews->GetControls()->Add(xtpControlButton,ID_VIEW_CONCISE);
        DockRightOf(pToolBarViews,pTBS);
    }

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2008 at 8:43am
Hi,
 
You create toolbar manually so have manually Load images.
 
Add bitmap + toolbar resource and call
 
pCOmmandBars->GetImageManager()->SetIcons(IDR_TOOLBAR_VIEWS);
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
JerryEvans View Drop Down
Groupie
Groupie
Avatar

Joined: 01 May 2008
Location: United Kingdom
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote JerryEvans Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2008 at 9:20am
Thanks Oleg - 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.