Hi,
I want to draw the themed border of a TEdit in a Paintbox. The code must be functional under Windows Vista and 7. I have 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;
Under Windows XP all ist OK. But under Windows Vista and 7 the border is painted in dark gray. All 4 sides in the same color. But a TEdit under Vista looks different: The top border has a dark gray. The right border a medium gray. The left and bottom borders have a light gray. I hope you understand the difference. How to paint it in the right way? Thanks!