Print Page | Close Window

CXTPControlBitmap on MenuBar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=16158
Printed Date: 29 November 2024 at 4:47am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPControlBitmap on MenuBar
Posted By: crystyce
Subject: CXTPControlBitmap on MenuBar
Date Posted: 08 February 2010 at 11:46am
How can I make a CXTPControlBitmap show up on a CXTPMenuBar?

I tried this, but I have no ideea how to load the bitmap on the control. Any other method to show a bitmap on the menu bar would be fine too, except for the one using a ReBar.

int CMainFrame::OnAfterCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
     CXTPMenuBar* pMenuBar = DYNAMIC_DOWNCAST(CXTPMenuBar, lpCreateControl->pCommandBar);
     if (pMenuBar)
     {
          pMenuBar->SetOwner(this);

          if (lpCreateControl->strCaption == _T("&Help"))
          {
               CXTPControlBitmap* pLabel = new CXTPControlBitmap();
               
               pMenuBar->GetControls()->Add(pLabel,IDB_LOGO);
               pLabel->SetFlags(pLabel->GetFlags() | xtpFlagRightAlign);
          }
     }

     return FALSE;

-------------
     Product: Xtreme SuitePro (MFC) version 13.1.0
     Platform: Windows XP (32bit) - SP 2
     Language: Visual C++ 2008



Replies:
Posted By: Oleg
Date Posted: 09 February 2010 at 2:41am

Hi,

to load it - add bitmap with IDB_LOGO to resources and line
 
 UINT nCommands2[] = {IDB_LOGO};
 pCommandBars->GetImageManager()->SetIcons(IDB_LOGO, nCommands2, _countof(nCommands2), xtpImageNormal);


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: crystyce
Date Posted: 09 February 2010 at 6:17am
thanks a lot, that works great !

-------------
     Product: Xtreme SuitePro (MFC) version 13.1.0
     Platform: Windows XP (32bit) - SP 2
     Language: Visual C++ 2008



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net