cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Kudo Kingpin
Kudo Kingpin

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
v-xida-msft
Community Support
Community Support

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.

View solution in original post

12 REPLIES 12
Drrickryp
Super User
Super User

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.

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,

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?

Hello, sorry my bad, please see enclosed file.

 

screen.png

panand99
Solution Supplier
Solution Supplier

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.

 

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

 

Group.png

panand99
Solution Supplier
Solution Supplier

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

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

 

Regards,

v-xida-msft
Community Support
Community Support

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.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,243)