请教高手,怎么遍历frame 上的 textbox 阿?
thank you

解决方案 »

  1.   

    Dim ctr As Control
        For Each ctr In Controls
            If TypeOf ctr Is TextBox Then
                ctr.Text = ""
            End If
        Next ctr
      

  2.   

    Dim vnt As Variant
                         For Each vnt In me.Controls
                            If TypeOf vnt Is TextBox Then
                                vnt.text=""
                            End If
                         next
      

  3.   

    同意,你还可以把你的text控件作为控件数组,这样操作也很好
      

  4.   

    Private Sub Command1_Click()    Dim a As Control    For Each a In Controls
            If TypeOf a Is TextBox And a.Container.Caption = "Frame1" Then
                a.Text = ""
            End If
        NextEnd Sub