我用一个循环遍历窗体上的所有控件并且如何使用VB代码获得每一个控件的属性列表!

解决方案 »

  1.   

    从菜单  视图--属性窗口
    或 从键盘 F4
    在你的Form窗口中左击你要编辑的控件就可以了
      

  2.   

    '引用TypeLib Infomation
    Dim a As InterfaceInfo
    Dim b As MemberInfo
    Dim m As ControlFor Each m In Me.Controls
        
        
        Set a = TLI.InterfaceInfoFromObject(m)
        
        For Each b In a.Members
            If b.InvokeKind = INVOKE_PROPERTYGET Then     '这里没有怎么仔细去考虑,似乎这里得到的仅只是控件具有Get的Property,可试着更改一下参数。因为有些属性是只能写入不能获取或者是只能获取不能写入的。还有别的设置。
                Debug.Print b.Name & vbTab & " ---------- " & vbTab & m.Name
            End If
        Next b
    Next
      

  3.   

    请问如何引用TypeLib Infomation
    :)