|  | 
| [SOLVED]PropertySheet theme issue | 
| Post Reply   | 
| Author | ||
| xsensordev   Groupie   Joined: 19 August 2021 Location: Canada Status: Offline Points: 27 |  Post Options  Thanks(0)  Quote  Reply  Topic: [SOLVED]PropertySheet theme issue Posted: 20 August 2021 at 2:46pm | |
| I've modified the Samples\Controls\PropertySheet sample that comes with Toolkit Pro 20.0 to test the effect of the Windows 10 dark theme on it. If the CXTPPropertySheet::SetTheme function is called BEFORE the CXTPPropertySheet::SetNavigator call, then I get this look:  If the CXTPPropertySheet::SetTheme function is called AFTER the CXTPPropertySheet::SetNavigator call, then I get this look:  Where's the title bar? To achieve this effect, I only modified CPropertySheetApp::InitInstance() and CPropertySheetDlg::OnButtonList(). My changes are BOLDED 
 
 If you switch to the theme to xtpIniWindows10Light, its the same bad titlebar effect:  Am I doing something wrong? | ||
|  | ||
| xsensordev   Groupie   Joined: 19 August 2021 Location: Canada Status: Offline Points: 27 |  Post Options  Thanks(0)  Quote  Reply  Posted: 20 August 2021 at 5:56pm | |
| 
   Okay I've spent several hours digging through the maze of cj code and managed to figure out the issue. The CXTPPropertySheet::SetTheme() call after the call to SetNavigator() causes CXTPCommandBars::EnableFrameTheme(TRUE) to be executed later in the call stack. The colors for the frame are in fact properly read from the INI dll via a call to 
 
 However, those colors are then wiped out with calls to XTPGetAccentColor() in CXTPFrameThemeNativeWindows10::RefreshMetrics(). Anyway my fix is to replace that function with the following: 
 | ||
|  | ||
| agontarenko   Moderator Group   Joined: 25 March 2016 Status: Offline Points: 332 |  Post Options  Thanks(0)  Quote  Reply  Posted: 26 August 2021 at 4:30am | |
| 
   Hello, See please CCustomizePageGeneral 
class in RibbonSample. I think, this class contains same functional what
 you need. You can to use XAML for controls with black themes in 
CXTPPropertyPage.  RegardsArtem Gontarenko | ||
|  | ||
| xsensordev   Groupie   Joined: 19 August 2021 Location: Canada Status: Offline Points: 27 |  Post Options  Thanks(0)  Quote  Reply  Posted: 26 August 2021 at 11:25am | |
| 
   Thank you Artem, I will give it a try. Best regards Terry R. @ xsensor.com
 | ||
|  | ||
| 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 |