B4J Question Loop No inLabels no Form

Discussion in 'B4J Questions' started by Geraldo Silva, Apr 5, 2019.

Tags:
  1. Geraldo Silva

    Geraldo Silva New Member Licensed User

    Hello .
    I need a help how can I loop in all form's Labels (B4j)?

    ????
    For i = 0 to MyForm.GetView ????

    log(label.text)

    Next
     
  2. DonManfred

    DonManfred Expert Licensed User

    Code:
    For Each n As Node In MainForm.RootPane.GetAllViewsRecursive
            
    Log(n)
            
    If n Is Label Then
                
    Dim lbl As Label = n
                
    Log("Label Text = "&lbl.Text)
            
    End If
        
    Next
     
    Harris, Erel and Kiffi like this.
  3. Erel

    Erel Administrator Staff Member Licensed User

    Another option:
    Code:
    For Each n As B4XView In MainForm.RootPane.GetAllViewsRecursive 'add a reference to XUI library
            If n Is Label Then
                
    Log("Label Text = "& n.Text)
            
    End If
        
    Next
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice