【问题标题】:How do I use TListBoxItems.OnPaint event to change the look of the TListBox?如何使用 TListBoxItems.OnPaint 事件来更改 TListBox 的外观?
【发布时间】:2013-04-22 00:05:23
【问题描述】:

我在下面使用这些代码,但是当我在 IOS sim 上运行程序时它没有显示该行。 我没有看到任何来自 embarcadero 的演示,有人知道怎么做吗?

我正在使用 Embarcadero Delphi XE4 for iOS。

procedure TForm1.ListBoxItem3Paint(Sender: TObject; Canvas: TCanvas;
  const ARect: TRectF);
begin
  Canvas.BeginScene;
  Canvas.DrawLine(ARect.TopLeft, ARect.BottomRight, 1);
  Canvas.EndScene;
end;

【问题讨论】:

    标签: ios delphi firemonkey delphi-xe4


    【解决方案1】:

    看来你必须在绘画之前设置笔触:

    procedure TForm1.ListBoxItem3Paint(Sender: TObject; Canvas: TCanvas;
        const ARect: TRectF);
    begin
      Canvas.Stroke.Thickness:=1;
      Canvas.Stroke.Kind:=TBrushKind.bkSolid;
      Canvas.Stroke.Color:=$FF000000;
      Canvas.DrawLine(ARect.TopLeft, ARect.BottomRight, 1);
    end;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-09
      • 2012-08-20
      • 2013-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-20
      • 1970-01-01
      相关资源
      最近更新 更多