Einzelnen Beitrag anzeigen

Benutzerbild von sh17
sh17

Registriert seit: 26. Okt 2005
Ort: Radebeul
1.594 Beiträge
 
Delphi 11 Alexandria
 
#11

Re: Welche Windows-Events zum Zeichnen eines Buttons

  Alt 20. Dez 2005, 08:21
Hab das Problem gefunden. Der ThemeManager muss auf dem Formular liegen, dann gehts.

Allerdings sollte in DefaultDrawBackground folgendes entfernt werden:

Delphi-Quellcode:
    { Note that changing the background color with active
      visual styles will *NOT* look good in most cases!
    }

    if (Brush.Color <> clBtnFace) and (Brush.Color <> clNone) then
    begin
      InflateRect(Rect, -1, -1);
      FillRect(Canvas.Handle, Rect, Brush.Handle);
      InflateRect(Rect, 1, 1);
    end;
und folgendes abgeändert:

Delphi-Quellcode:
    if Brush.Color <> clNone then
      FillRect(Canvas.Handle, Rect, Brush.Handle);
in

  FillRect(Canvas.Handle, Rect, GetSysColorBrush(COLOR_BTNFACE));Rect, Brush.Handle); So wird das "normale" Verhalten von Windows erzeugt.

Ich nutze teilweise andersfarbige Hintergründe.
Sven Harazim
--
  Mit Zitat antworten Zitat