Print Page | Close Window

I hope insert true color icon to toolbar.

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=13360
Printed Date: 28 February 2025 at 4:36am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: I hope insert true color icon to toolbar.
Posted By: copycdx2
Subject: I hope insert true color icon to toolbar.
Date Posted: 09 February 2009 at 2:13am
why not display icon??
how do display true icon??
 
 
 
  CXTPToolBar* pToolbar = (CXTPToolBar*) pCommandBars->Add(_T("ncControlToolbar"), xtpBarTop);
   pNCControlToolbar->SetBarID(IDR_TOOLBAR_NC02);
I want treecolor image.
pNCControlToolbar->GetImageManager()->SetImageList( IDB_TESTTOOLBAR, 16, ID_NCTOOLBARBASE );

  CXTPControlButton* pButton = (CXTPControlButton*)pNCControlToolbar->GetControls()->Add(xtpControlButton, ID_NCTOOLBARBASE+1/*ID_NCSHOWGAMEPROG*/ );
  pButton->SetStyle(xtpButtonIconAndCaption);
//  pButton->SetIconId( 1 );
  pButton->SetIconSize( CSize(16,16) );
  pButton->SetWidth( 100);

 
 



Replies:
Posted By: Oleg
Date Posted: 09 February 2009 at 4:51am
Hi,
 
Most easy way is to add Toolbar resource, add icons you need for Id you need, replace generated bmp file and in code add
 
pCommandBars->GetImageManager()->SetIcons(IDR_TOOLBAR_RESOURCE);


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


Posted By: mdoubson
Date Posted: 25 March 2009 at 10:51pm
You use default colorMask:

BOOL SetImageList(UINT nIDResourceBitmap, int cx, int nBaseCommand = 0, COLORREF clrMask = (COLORREF)-1);

May be the problem here?


-------------
Mark Doubson, Ph.D.



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