La soluzione di
@Lello1964 và bene se i Button vengono creati da codice (cosa che è meglio evitare nel 90% dei casi).
Se i Button sono stati aggiunti nel Layout tramite Designer allora puoi provare così
Dim count As Int = 1
For Each v As View In Activity.GetAllViewsRecursive
If v Is Button Then
v.As(Button).Text = "Button " & count
count = count + 1
End If
Next
NOTA BENE: quì faccio riferimento ad un progetto DEFAULT che utilizza le Activity. Dovresti evitarlo fin da subito e passare immediatamente alle B4XPages.
Trovi un video che le introduce quì (oltre a tanti esempi sul forum)
https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=440642051
In quel caso dovresti solo cambiare ACTIVITY con ROOT
Dim count As Int = 1
For Each v As View In Root.GetAllViewsRecursive
If v Is Button Then
v.As(Button).Text = "Button " & count
count = count + 1
End If
Next