我是建了1个trackbar,然后复制了8个。
用下面的命令历遍控件。
但是发现不是按照先后顺序,是跳着历遍的,这个顺序是怎么定的?
For Each c As WinForm.Control In e.Form.Controls
If Typeof c Is WinForm.trackbar Then
Dim t As WinForm.trackbar = c
For Each cl As DataCol In DataTables("or3d").DataCols
If t.name & "_pec"=cl.name Then
Dim lbl As WinForm.Label
lbl = e.Form.CreateControl("completerate" & i,ControlTypeEnum.Label)
lbl.text=t.value & "Set "
lbl.Left=t.left-50
lbl.Top=t.Top+25
lbl.AutoSize=True
lbl.TopMost=False
e.Form.AddControl(lbl)
i+=1
因为后面要引用lbl的名字,但是历遍不是按照trackbar的顺序历遍,到时加载的控件也是错误的顺序。