我试图在网格的单元格中显示一个充满绿色/红色的指示性圆圈,而没有描边颜色。网格显示了许多其他类似的实体,但也可以有一个数值而不是预期的圆圈。
作为参考,我包含以下代码以仅在第一个单元格中显示该圆圈。但是使用的方法取决于笔画类型,不设置为 TBrushKind.None 并且也不提供自定义填充颜色、边距或填充功能:-
procedure TUI.CR_UL_UsersGridDrawColumnCell
( Sender : TObject;
const Canvas : TCanvas;
const Column : TColumn;
const Bounds : TRectF;
const Row : Integer;
const Value : TValue;
const State : TGridDrawStates );
begin
if ( Column.Index = 0 ) and ( Row = 0 ) then
begin
Canvas.DrawEllipse ( Bounds, 100 );
end
else
CR_UL_UsersGrid.DefaultDrawColumnCell
( Canvas, Column, Bounds, Row, Value, State );
end;
如果可能的话,有没有办法将 TCircle 实际添加到单元格或任何其他解决方案?