Reflection Desktop VBA Guide
Attachmate.Reflection.Objects Library / Attachmate.Reflection.Objects.UserInterface Library / UiControl Object
In This Topic
    UiControl Object
    In This Topic
    Defines properties and operations on the UI control object.
    Remarks
    You cannot programmatically add controls. If you know the control ID, you can hide, show, and remap the control.
    Example
    This example illustrates how to use a recursive function to enumerate all the UiControl objects that make up the Reflection Ribbon. It prints the id value of each UiControl object to the "immediate" pane in the Visual Basic editor.
    Public Sub EnumerateUIControls()
    Dim controls() As UiControl
    Dim ctrlContainer As UiControlContainer
    Dim i As Long
    controls = ThisView.UiMode.SubItems
     
    For i = 0 To UBound(controls)
    Debug.Print controls(i).id
     
    Set ctrlContainer = controls(i)
    RecurseSubItems ctrlContainer.SubItems
    Next
     
    End Sub
     
    Private Sub RecurseSubItems(ctrls() As UiControl)
    Dim container As UiControlContainer
    Dim i As Long
     
    If UBound(ctrls) >= 0 Then
    For i = 0 To UBound(ctrls)
     
    Debug.Print ctrls(i).id
     
    On Error Resume Next
    Set container = ctrls(i)
    If Err = 0 Then
    RecurseSubItems container.SubItems
    Else
    Err.Clear
    End If
    Next
    End If
    End Sub
    See Also