[RESOLVED]CXTPControlCustom and Office 2010 theme |
Post Reply |
Author | |
Dan
Groupie Joined: 11 June 2014 Status: Offline Points: 16 |
Post Options
Thanks(0)
Posted: 06 October 2016 at 6:28am |
Hi,
I'm trying to add a custom-made class derived from the MFC CComboBox to our Ribbon Bar next to the Tab captions. I'm using v16.3.1 of Codejock. Here is the relevant code ... m_pComboExt = new CComboBoxExt(); m_pComboExt->Create(CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS, CRect(0,0,100,100), this, ID_CMD_SEARCH2); CXTPControlCustom *pControl = CXTPControlCustom::CreateControlCustom(m_pComboExt); m_pRibbonBar->GetControls()->Add(pControl, ID_CMD_SEARCH2, nullptr, -1); The combo-box appears where and I want and is fully functional, BUT, when using any of the Office 2010 themes the text in the Edit box portion of the ComboBox is barely readable. For some reason it is transparent and so it completely depends on what is behind my application whether you can read the text or not. The non Office 2010 themes do not have this problem. The top half of the image shows an Office 2010 theme, the bottom is the Windows 7 Scenic theme. Please can you give me any ideas about to fix/work-around the problem? |
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(0)
|
Hello Dan,
To disable frame transparent option for Office2010 style, you should be set CXTPCommandBarsFrameHook::m_bAllowDwm = FALSE; Regards, Artem Gontarenko |
|
Dan
Groupie Joined: 11 June 2014 Status: Offline Points: 16 |
Post Options
Thanks(0)
|
Hi Artem,
Thanks for the suggestion. Unfortunately disabling DWM seemed to cause all sorts of problems with the re-drawing of our main application window (which is using OpenGL) so I couldn't do that. Since all the Office 2007 themes were working - and they only make the very top part of the Window transparent (where the caption and Quick Access Toolbar live) - I decided to try and make the Office 2010 themes have the same behaviour (i.e to disable the transparency behind the Ribbon Bar tab captions). After looking through the source code I discovered that I could do that by editing the 3 Office 2010 ini files (BlueTheme.ini, BlackTheme.ini and SilverTheme.ini) by changing FlatFrame = 1 to FlatFrame = 0 and re-building the Office2010 style DLL. It means our application will look a little different now but I think that change is acceptable. The custom ComboBox now looks as expected. Thanks, Dan
|
|
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 |