I want to draw a TEdit theme border in Paintbox. The code should work under Windows Vista and 7. I tried the following. It works only under Windows XP.
var
Details: TThemedElementDetails; //uses Themes
begin
if ThemeServices.ThemesEnabled then
begin
Details := ThemeServices.GetElementDetails(teEditRoot);
ThemeServices.DrawElement(PaintBox1.Canvas.Handle, Details, PaintBox1.ClientRect);
end;
end;
In Windows XP, everything is fine. But under Windows Vista and 7, the border is dark gray. All 4 sides are the same color. But TEdit for Vista looks different: the upper border is dark gray. The right border is medium gray. The left and bottom borders are light gray. Hope you understand the difference. How to draw it right? Thank!
source
share