Thema: Delphi Falsche Fontfarbe

Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#2

AW: Falsche Fontfarbe

  Alt 8. Okt 2016, 19:47
Ok
Anscheinend will oder kann mir niemand helfen.

Habe es jetzt selbst bereinigt.
Das Problem ist das TColor nicht gleich System Color ist.
Deshalb musste ich die Farben übersetzen. (Was für eine Schmarrn)

Anwendung:
Delphi-Quellcode:
       if TWinControl(Comp.Controls[i]) = Form1.CheckBox1 then
       begin
         CB.Font := Form1.CheckBox1.Font;
         CB.BackColor := Form1.CheckBox1.Color;
         CB.Connect;
       end else if TWinControl(Comp.Controls[i]) = Form1.CheckBox2 then
       begin
         CB.Font := Form1.CheckBox2.Font;
         CB.BackColor := Form1.CheckBox2.Color;
         CB.Connect;
       end else if TWinControl(Comp.Controls[i]) = Form1.CheckBox3 then
       begin
         CB.Font := Form1.CheckBox3.Font;
         CB.BackColor := Form1.CheckBox3.Color;
         CB.Connect;
       end;
DLL:
  SetTextColor(DC, TranslateColor(Font.Color));
Delphi-Quellcode:
function TranslateColor(AClr: Integer): Colorref;
begin

  If (AClr and $80000000) = $80000000 then
    Result := GetSysColor(AClr and $FF)
  else
    Result := AClr;
end;
gruss
  Mit Zitat antworten Zitat