Registriert seit: 20. Jan 2006
Ort: Lübbecke
11.453 Beiträge
Delphi 12 Athens
|
AW: Auf den canvas einer TListView zeichnen?
19. Sep 2024, 20:17
Etwa so?
Der Code dazu im OnAdvancedCustomDraw:
Delphi-Quellcode:
if Stage = TCustomDrawStage.cdPostPaint then
begin
var R1 := Sender.Items[2].DisplayRect(drBounds);
var R2 := Sender.Items[8].DisplayRect(drBounds);
var P1 := TPoint.Create(R1.Right, R1.CenterPoint.Y);
var P2 := TPoint.Create(R2.Right, R2.CenterPoint.Y);
P2.X := ARect.Right - 10;
P1.X := P2.X - 10;
Sender.Canvas.Pen.Color := clRed;
Sender.Canvas.Pen.Width := 2;
Sender.Canvas.MoveTo(P1.X, P1.Y);
Sender.Canvas.LineTo(P2.X, P1.Y);
Sender.Canvas.LineTo(P2.X, P2.Y);
Sender.Canvas.LineTo(P1.X, P2.Y);
end;
|