Your code seems far too complicated for the simple task that you describe. Assuming that all the views in pnlButtons are buttons -
Sub Test
Private c As CustomContact
c.Initialize
Dim counter As Int = 0
For Each b As Button In pnlButtons.GetAllViewsRecursive
If (counter < contactsList.Size) Then
c = contactsList.Get(counter)
b.Text = c.DisplayName
b.Tag = c.phoneNumber
b.Enabled = True
b.Visible = True
counter = counter + 1
End If
Next
End Sub
If the panel contains views that are not buttons then iterate through all views but check for buttons . . .
For Each v As View In pnlButtons.GetAllViewsRecursive
If (v Is Button) Then
If (counter < contactsList.Size) Then
....
....
End If
End If
Next
If some of your buttons are already filled and you want to skip over them, then skip . . .
For Each b As Button In pnlButtons.GetAllViewsRecursive
If (b.Text.Length = 0) Then
If (counter < contactsList.Size) Then
c = contactsList.Get(counter)
....
By the way, when you want to include a code fragment in a post use the </> option at the top left of the reply window.