![]() |
Toolbar button colors |
Post Reply
|
| Author | |
venkyhyd
Groupie
Joined: 29 June 2006 Location: India Status: Offline Points: 70 |
Post Options
Thanks(0)
Quote Reply
Topic: Toolbar button colorsPosted: 01 August 2006 at 12:43am |
|
hi
how can we dynamically change the color of a particular button in a specific toolbar.
Thanks
|
|
![]() |
|
venkyhyd
Groupie
Joined: 29 June 2006 Location: India Status: Offline Points: 70 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 August 2006 at 12:11am |
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
venkyhyd
Groupie
Joined: 29 June 2006 Location: India Status: Offline Points: 70 |
Post Options
Thanks(0)
Quote Reply
Posted: 04 August 2006 at 7:32am |
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
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |