多个Pointer(指针)

前面介绍的Pointer是主指针。

一个仪表可以有多个指针,例如我们要设计一个时钟,那么就应该有时、分、秒三个指针。

设计过程很简单,首先将Pointer(主指针)的Visible属性设置为False,然后打开MorePointers成员编辑创窗口,增加三个指针即可:

建议每个指针都通过Name属性指定名称,以方便在代码中引用指针,注意代码中的Name是区分大小写的:

Dim gg As WinForm.Gauges = e.Form.Controls("Guages1")
gg.RadialGauge.MorePointers(
"Hour").Value = 9
gg.RadialGauge.MorePointers(
"Minute").Value = 30
gg.RadialGauge.MorePointers(
"Second").Value = 20

如果不指定Name属性,就只能通过索引位置来引用指针了,很容易混淆:

Dim gg As WinForm.Gauges = e.Form.Controls("Guages1")
gg.RadialGauge.MorePointers(0).Value = 9
gg.RadialGauge.MorePointers(1).Value = 30

gg.RadialGauge.MorePointers(2).Value = 20

当然,MorePointers集合中的指针也是GaugePonter类型,例如:

Dim gg As WinForm.Gauges = e.Form.Controls("Guages1")
Dim
pt As GaugePointer = gg.RadialGauge.MorePointers(0)
pt.Offset = 0

p
t.Shape = C1.Win.C1Gauge.C1GaugePointerShape.Round


本页地址:http://www.foxtable.com/webhelp/topics/3785.htm