Android Question how to iterate over many button(i)

IslandMedic

Member
Licensed User
Longtime User
B4X:
Sub color_buttons( pushed_button As Int)
    For i = 1 To 16
        Button(i).color = Colors.LightGray
        If pushed_button = i Then
            Button(i).color = Colors.DarkGray
        End If
    Next
End Sub

the idea is when one button is pushed need to reset the color on all others and set the one pushed to dark gray. is this possible to iterate over all the buttons instead of one at a time?

thanks
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…