Dim obj As Object
For Each obj In Me.Controls
   MsgBox obj.Name
Next

解决方案 »

  1.   

    Dim xx As Control
    For Each xx In Form1.Controls
      List1.AddItem xx.Name
    Next
      

  2.   

    '还可以判断控件数组
    Private Sub Command1_Click()
    Dim x As VB.Control
    For Each x In Me.Controls
        If VBA.VarType(VBA.CallByName(Me, x.Name, VbGet)) = vbObject Then       '控件数组
           Debug.Print x.Name & ".Item(" & x.Index & ")"
        Else
           Debug.Print x.Name
        End If
    Next x
    End Sub
      

  3.   

    Dim obj As Object
    For Each obj In Me.Controls
       MsgBox obj.Name
    Next
    比较简单