Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Toolbar button colors
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Toolbar button colors

 Post Reply Post Reply
Author
Message
venkyhyd View Drop Down
Groupie
Groupie


Joined: 29 June 2006
Location: India
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote venkyhyd Quote  Post ReplyReply Direct Link To This Post Topic: Toolbar button colors
    Posted: 01 August 2006 at 12:43am
hi
 
how can we dynamically change the color of a particular button in a specific toolbar.
 
Thanks
Back to Top
venkyhyd View Drop Down
Groupie
Groupie


Joined: 29 June 2006
Location: India
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote venkyhyd Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
Back to Top
venkyhyd View Drop Down
Groupie
Groupie


Joined: 29 June 2006
Location: India
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote venkyhyd Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
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.031 seconds.