Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [RESOLVED]CXTPControlCustom and Office 2010 theme
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[RESOLVED]CXTPControlCustom and Office 2010 theme

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


Joined: 11 June 2014
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan Quote  Post ReplyReply Direct Link To This Post Topic: [RESOLVED]CXTPControlCustom and Office 2010 theme
    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?


Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post Posted: 08 October 2016 at 7:48am
Hello Dan,

To disable frame transparent option for Office2010 style, you should be set
CXTPCommandBarsFrameHook::m_bAllowDwm = FALSE;

Regards,
Artem Gontarenko 
Back to Top
Dan View Drop Down
Groupie
Groupie


Joined: 11 June 2014
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dan Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2016 at 9:49am
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
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.266 seconds.