Einzelnen Beitrag anzeigen

hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.270 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: TCheckBox.Color über WM_CTLCOLOR

  Alt 2. Aug 2016, 07:59
Hallo,

ja, schon bemerkt.

    procedure WMCTLColor(var msg: TWMCtlColorStatic); message WM_CTLCOLORSTATIC; Aber was muss ich machen, um jetzt die Farbe zu ändern.
Ich bekomme immer Bereichsfehler.
Das kann doch nicht sooo schwer sein, verd...

Delphi-Quellcode:
procedure TForm101.WMCTLColor(var msg: TWMCtlColorStatic);
begin
  inherited ;

  //SetTextColor(Msg.ChildDC,RGB(0,$80,0));
  //Exit;

  //SetTextColor(Msg.wParam,RGB(0,$80,0));


  if msg.ChildWnd=CheckBox2.Handle then
  begin
    //msg.Result := CreateSolidBrush(RGB(0, 0, 0));
    //SetTextColor(Msg.ChildDC,RGB(0,$80,0)); // <<-- Bereichsfehler !

    msg.Result := GetStockObject(NULL_BRUSH);
  end;

end;
Heiko
  Mit Zitat antworten Zitat