cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sajarac
Level 8

Color button fill

Hi there, 

 

Quick an silly question here?

 

I have five screens and in the first screen I have 4 different buttons to navigate to the rest of the screens, how can I change the fill color property so when an button is pressed navigate to that page and keep a different color to differenciate form others?

 

Thanks in advance.

 

Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Color button fill

Hi @sajarac,

 

Have you solved your problem?

Do you want to change the Fill color of the Button control when you click the Button?

 

I agree with @panand99's thought almost. I have made a test on my side, please take a try with the following workaround:

 

Set the OnSelect property of the "Group1" control to following formula:

Navigate(Screen2,ScreenTransition.Cover);Set(SelectedGroup,"Group1")

Set the Fill property of the "Group1" control to following formula:

If(SelectedGroup="Group1",RGBA(153, 207, 236, 1),RGBA(130, 141, 158, 1))

For other Groups, please take a try with the following formula:

 

Set OnSelect property to following formula:

Navigate(ScreenN,ScreenTransition.Cover);Set(SelectedGroup,"GroupN")

Set Fill property to following formula:

If(SelectedGroup="GroupN",RGBA(153, 207, 236, 1),RGBA(130, 141, 158, 1))

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
12 REPLIES 12
Super User
Super User

Re: Color button fill

Hi @sajarac,

 

If Button1 navigates to a particular screen set the Fill property of the target screen or any control on that screen that has a a Fill property to: Button1.Fill.  If each navigation button on the first screen is a different color, then the fill property of the target screen or control on that screen will be the same as the button that is pressed.

sajarac
Level 8

Re: Color button fill

Hi, thank you very mcuh for your prompt reply, sorry but I don't get it.

 

What I would like is : once the user is in any specif page that belogs to the pressed button have that button filled with the different color to differenctiate.

 

Regards,

Super User
Super User

Re: Color button fill

Sorry @sajarac, I'm a bit confused.  Could you upload a picture from your app that shows what you are trying to do please.  The term "page" has no meaning in Powerapps, are you referring to a screen?

sajarac
Level 8

Re: Color button fill

Hello, sorry my bad, please see enclosed file.

 

screen.png

panand99
Level 8

Re: Color button fill

You can sets a local variable once you select first image like 

 

UpdateContext({selectedImage:"Image1"})

 

and on second 

UpdateContext({selectedImage:"Image2"})

Then on the all images image.fill property, you can use this variable if (selectedImage="Image1", <<color>>,<<defaultcolor>>). like that you can use.

 

sajarac
Level 8

Re: Color button fill

Hi thank you very much, in my case the group is a combination of label, imagen and button, will this works?

 

Group.png

panand99
Level 8

Re: Color button fill

Yes, you can bind them in one group. this will work

sajarac
Level 8

Re: Color button fill

Thank you very much for your prompt reply, I will try and update this ticket.

 

Regards,

Community Support Team
Community Support Team

Re: Color button fill

Hi @sajarac,

 

Have you solved your problem?

Do you want to change the Fill color of the Button control when you click the Button?

 

I agree with @panand99's thought almost. I have made a test on my side, please take a try with the following workaround:

 

Set the OnSelect property of the "Group1" control to following formula:

Navigate(Screen2,ScreenTransition.Cover);Set(SelectedGroup,"Group1")

Set the Fill property of the "Group1" control to following formula:

If(SelectedGroup="Group1",RGBA(153, 207, 236, 1),RGBA(130, 141, 158, 1))

For other Groups, please take a try with the following formula:

 

Set OnSelect property to following formula:

Navigate(ScreenN,ScreenTransition.Cover);Set(SelectedGroup,"GroupN")

Set Fill property to following formula:

If(SelectedGroup="GroupN",RGBA(153, 207, 236, 1),RGBA(130, 141, 158, 1))

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.