如何列遍form上的所有菜单? 我目的是要得到这个form上的所有菜单名称.
谢谢!

解决方案 »

  1.   

    Private Sub Form_Load()
    Dim dd As Object
    For Each dd In Me.Controls
        If UCase(TypeName(dd)) = "MENU" Then
            List1.AddItem dd.Caption
        End If
    NextEnd Sub
      

  2.   

    http://community.csdn.net/Expert/topic/4265/4265012.xml?temp=.8161432
      

  3.   

    Private Sub Command1_Click()
        Dim mu As Object
        For Each mu In Me.Controls
            If UCase(TypeName(mu)) = "MENU" Then
                Debug.Print mu.Caption
            End If
        Next
    End Sub
      

  4.   

    我也来接分:
    Private Sub Command1_Click()
        Dim mu As Object
        For Each mu In Me.Controls
            If UCase(TypeName(mu)) = "MENU" Then
                Debug.Print mu.Caption & mu.Name
            End If
        Next
    End Sub