TShape 和整数值

TShape and Integer Value

我最近在研究 Dart-Counter。 我在 TImage 上展示了一个飞镖板,每个计数位置都有一个 TShape

是否可以为 TShape 赋值,因为 TShape 不喜欢整数?

谢谢。

您可以使用 Tag 属性 来存储您的整数值,如果没有其他东西使用 属性。

Tag has no predefined meaning. The Tag property can store any additional integer value for the convenience of developers.

另一种方法是派生出 TShape 的 sub-class 并添加 属性 来存储信息。这将允许您给 属性 一个更有意义的名称,并使意图明确。

我想说的是,用 TShape 对象构建复杂的可视化用户界面可能是执行任务的一种低效且容易出错的方法。通常对于这样的任务,最好制作一个适当地绘制自身的自定义控件,而不使用 sub-components.