那直接 visible = false 得了

解决方案 »

  1.   

    Public Sub SetFrameEnabled(ByVal f As Frame, ByVal Enabled As Boolean)
        Dim op As Long
        op = ObjPtr(f)
        
        On Local Error Resume Next
        
        Dim c As Control
        For Each c In f.Parent.Controls
            If ObjPtr(c.Container) = op Then
                c.Enabled = Enabled
            End If
        Next c
        
    End Sub
      

  2.   

    楼上的,要加上个错误处理:on error resume next;