Print Page | Close Window

Toolbar button colors

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4690
Printed Date: 11 November 2025 at 12:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Toolbar button colors
Posted By: venkyhyd
Subject: Toolbar button colors
Date Posted: 01 August 2006 at 12:43am
hi
 
how can we dynamically change the color of a particular button in a specific toolbar.
 
Thanks



Replies:
Posted By: venkyhyd
Date Posted: 02 August 2006 at 12:11am
Cry
Originally posted by venkyhyd venkyhyd wrote:

hi
 
how can we dynamically change the color of a particular button in a specific toolbar.
 
Thanks


Posted By: Oleg
Date Posted: 02 August 2006 at 4:53pm
Hello,
 
There is no buildin method. But you can always override paint manager and its DrawControlToolbarParent method and fill contol.


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


Posted By: venkyhyd
Date Posted: 04 August 2006 at 7:32am
Originally posted by oleg oleg wrote:

There is no buildin method. But you can always override paint manager and its DrawControlToolbarParent method and fill contol.
 
Hello
 
We could draw borders around the button in the Toolbar, using the following code:

CXTPCommandBars* pCommandBars = GetCommandBars();

CXTPToolBar* pMYTOOLBAR=pCommandBars->GetToolBar(IDR_MAINFRAME);

int i=pMYTOOLBAR->GetControls()->GetCount();

CXTPControl* pControl=pMYTOOLBAR->GetControls()->GetAt(1); //Note: here 1 should be the Button Id;

CRect rc;

rc=pControl->GetRect();

CDC* pDC = pMYTOOLBAR->GetDC();

pControl->GetPaintManager()->Draw3dRect(pDC,rc,0,0);

But with this we are able to draw border to the button and on the mouse move over the Toolbar the button is getting refreshed and Border is not persisting.
 
Can you suggest on this or any other work around to implement this.
 
thanks


Posted By: Oleg
Date Posted: 04 August 2006 at 8:24am
Hi
 
Try CustomThemes sample - it show how use custom paint managers. Check how it works, check DrawRectangle methods.


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



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