Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-09

PageControl color

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Benito van der Zander

Hi,
if you enable theming in Windows XP the background color of a TPageControl changes from gray (clBtnFace)
to white (is this clWhite or a system color?).
The problem is now, that a TTrackBar or a TStringGrid always draw there background as clBtnFace, which
looks quite stranges on a white background.
So how do you set the correct color?
if ThemeServices.ThemesEnabled then TrackBar1.Color:=clWhite; seems to work on xp, but assumes of curse that the themed color is always white.

Benito

Reply by email

Paul Ishenin
to Benito van der Zander
Benito van der Zander wrote 11 lines
Hi, if you enable theming in Windows XP the background color of a TPageControl changes from gray (clBtnFace) to white (is this clWhite or a system color?). The problem is now, that a TTrackBar or a TStringGrid always draw there background as clBtnFace, which looks quite stranges on a white background. So how do you set the correct color? if ThemeServices.ThemesEnabled then TrackBar1.Color:=clWhite; seems to work on xp, but assumes of curse that the themed color is always white.

TTrackBar is a windows common control. We need to correct win32 widgetset code to let it draw transparently on parent controls if themes are enabled. Feel free to create a patch which solves this problem.

TStringGrid is a control which LCL draws itself. We need to use more themes painting to make it look more native. This can be done later.

And, btw, color is not clWhite - theme services are using bitmaps to draw control surfaces. If you change theme to another it can look as Blue or Black or as any other color.

Best regards,
Paul Ishenin.

Reply by email