CXTPTabControl - Set single tab color |
Post Reply |
Author | |
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
Posted: 27 May 2011 at 6:34am |
Problem is to set the color background of a single tab in CXTPTabControl.
Tab control is themed via: wndTabControl.GetPaintManager()->SetAppearance(xtpTabAppearancePropertyPageFlat); wndTabControl.GetPaintManager()->SetColor(xtpTabColorOffice2003); wndTabControl.GetPaintManager()->DisableLunaColors(FALSE); Now I try setting a single tab backgroud to red via: wndTabControl.GetItem(3)->SetColor(RGB(0xFF, 0x00, 0x00)); But tab backgroud remains unchanged. Any advice? |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi;
Try to handle ON_MESSAGE(WM_XTP_GETTABCOLOR, OnGetTabColor) HTH |
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
mgampi, thanx, didn't worked as I wanted.
Okay, perhaps this is useful for someone who as a similar problem: Tab colors only work in "OneNoteColor" mode, so enable this via wndTabControl.GetPaintManager()->SetOneNoteColors(TRUE); Then derive your own control and override GetItemColor class CXTPTabControlEx : public CXTPTabControl { public: COLORREF GetItemColor(const CXTPTabManagerItem* pItem) const { return pItem->IsSelected() ? GetPaintManager()->GetColorSet()->m_clrButtonSelected : OwnColor here ; } }; |
|
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 |