Hi,
On Windows (10) a TTabSheet of a TPageControl looks hideous (its white on my default (not dark) theme).
I have one application where I diable theming for a specific TPageControl using this code in the form's OnCreate
UxTheme.SetWindowTheme(NoteBook.Handle, nil, ''); //NoteBook is a TPageControl
This works like I want it to be: the TTabSheets have the same color as the form they reside on (standard clForm color).
Now: in another application I wanted to do the same:
I have a NoteBook: TPageControl on a Form.
I run the same code ase above in the form's OnCreate.
But to no effect: the TTabSheet remains white (not clForm).
I tried setting the TTabSheet.Color to clForm: to no avail.
I tried to disable theming on the TTabSheet, but the effect was that no text was shown anywhere on the form anymore in any control (outside the TPageControl).
I rebuild the application where it worked (thinking either something changed in Lazarus, or in Windows), and that application still works as I want (theming on the TPageControl is disabled).
The only difference between these 2 situations is that in the application where it works, the form is the main form.
In the application where it does not work, the form is a dialog (not the main form).
So, I put a TPageControl on the main form of the application where it did not work, disabled theming for it, and lo and behold: it worked.
After some testing I found out that the "problem" is that I use ShowModal to show the dialog form in question.
If I do a simple Show then the theming of the TPageControl is disabled, the TTabSheets have the clForm color.
Does anyone know why this is the case?
Do I use the wrong parameters for SetWindowTheme()?
Note: it returns S_OK, I checked.
Bart