Multiple component modif

I'd like change componants background color from a variable containing componant id in order to have just a simple short procedure for different could i do that ?

There are two ways of doing it.
If you want to use the component ID somewhere else other than the procedure too, then try this (global variables) -

If you wish to use the component ID only in the procedure, then use local variables.

PS: I corrected your spelling of component but couldn't get what "modif" is :grin:

You're right, but this way i have to explicitly change each BackgroundClolor...
I must do it on a lot of componants, so my idea was to do it througth a "for" loop...

You can create a list if component IDs whos BGcolor u would like to change.
Then use the for each item in list block to set the BG color.
This should slove your problem

Hello Jean-marc

Are the components all of the same type? e.g. all buttons?

yes, that's what i want to do, but which instruction do i use to set BG color to an item from a list ?

yes they are

I'll make a little example - give me ten minutes + coffee time.

So, like this (you could for example have the User select the colours they want to use, this just changes the default button colours when the App is opened). In the same loop you can change most of the other attributes as well.

ChangeButtonColour.aia (2.4 KB)

1 Like

perfect ! it's just what i want !
but where do you find tis block ??.

Oh i find it !
it si in "Any component"!
i wondered what was "any component" was for !!!

thanks very much !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.