1,446
社区成员




Option Explicit
Private Sub SSTab1_DblClick()
Dim frm As Object
Dim ctl As Control
Set frm = GetForm()
If Not frm Is Nothing Then
If TypeOf frm Is Form Then
For Each ctl In frm.Controls
If ctl.Container Is UserControl.Extender Then
'本意是将这个控件上的子控件的Container设置到sstab上来
'实际证明,在运行的时候,这里就出错了
Set ctl.Container = SSTab1
End If
Next
End If
End If
Set frm = Nothing
Set ctl = Nothing
End Sub
Private Sub UserControl_Resize()
With SSTab1
.Move 0, 0, UserControl.Width, UserControl.Height
End With
End Sub
Public Property Get ThisObject() As Object
Set ThisObject = SSTab1
End Property
Private Function GetForm() As Object
Dim obj As Object
Do
Set obj = UserControl.Parent
Loop Until (TypeOf obj Is Form)
Set GetForm = obj
Set obj = Nothing
End Function