Android Question change the properties of a group of components. [Solved]

FernandoMassa

Member
Licensed User
Longtime User
Hello, I'm Delphi programmer, and I'm migrating to B4A.
When I want to change the properties of a group of components, I can usually do the following in Delhpi.
Example:
for i: = 0 to ComponentCount -1 of
begin
if Components is TEdit then
TEdit (Components ) color: = clWhite;
end;

Reason:
I want to do this:
BackgroundText.Initialize (Colors.White, 5)
edtNome.Background = BackgroundText
edtSobrenome.Background = BackgroundText
edtCEP.Background = BackgroundText
edtRua.Background = BackgroundText
edtBairro.Background = BackgroundText
edtCidade.Background = BackgroundText
edtPais.Background = BackgroundText
edtEmail.Background = BackgroundText
edtComplemento.Background = BackgroundText
edtNumero.Background = BackgroundText

only without having to type one by one.

I do not know if I could make myself understood?:D
 

FernandoMassa

Member
Licensed User
Longtime User
For example
B4X:
For i = 0 To Activity.NumberOfViews - 1
  If Activity.GetView(i) Is Button Then
   Dim b As Button
   b = Activity.GetView(i)
   b.Color = Colors.Blue
  End If
Next

You can use also
B4X:
For Each v As View In Activity.GetAllViewsRecursive
...
Next

thanks for the quick response!!!
An honor to be part of this group!
I hope in the future also to be able to help the beginners. :)
 
Upvote 0

BillMeyer

Well-Known Member
Licensed User
Longtime User
thanks for the quick response!!!
An honor to be part of this group!
I hope in the future also to be able to help the beginners. :)

Welcome Noob to BoB (Band of Brothers) !!
You will be able to help others - pretty soon too !!
 
Upvote 0
Top