Hallo,
eventuell hilft Dir das weiter, der Code zeichnet ein rotes Kreutz über eine RadioGroup:
Delphi-Quellcode:
//...
private
FCanvas: TControlCanvas;
//...
procedure TForm1.FormCreate(Sender: TObject);
begin
FCanvas:=TControlCanvas.Create;
FCanvas.Control := RadioGroup1;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
FCanvas.Free;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FCanvas.Pen.Color := clRed;
FCanvas.MoveTo(0,0);
FCanvas.LineTo(RadioGroup1.Width,RadioGroup1.Height);
FCanvas.MoveTo(RadioGroup1.Width,0);
FCanvas.LineTo(0,RadioGroup1.Height);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//Kreutz entfernen
RadioGroup1.Repaint;
end;