Public Property Let objButton(ByVal sInput As ctButton)
Set mvarObjButton = sInput
End Property
窗体上的程序
Sub LoadButton(currentItem As Integer)
Dim Ct As Control
Dim col As New Collection
'Dim ctButton As cXpButton
For Each Ct In Me.navWindows.Pages(currentItem).Controls '只在当前页中循环
If Ct.ControlType = 119 And Left(Ct.ControlName, 8) = "ctButton" Then
Dim myCtButton As New cXpButton
Dim tempButton As ctButton
Set tempButton = Me.Controls(Ct.ControlName)
myCtButton.objButton = tempButton
col.Add myCtButton '将所有的ctbutton加入到col集合中去。
End If
Next
End Sub