cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
scnative
Helper II
Helper II

PowerApps Button Color Change on Form Load

I've seen posts similar, but we have 1 screen with 3 forms on the one screen.  Patch wasn't working, so this ensures all data is posted.  

 

Form Name / Button Name:

 

Main / Main

AddInfo / Additional Information

Status / Status

 

When a form is loaded, I want the button that corresponds to the title to display a different color.  For example, if user clicks button "Main" - I want the Main button to change color, and keep that color, until another button is clicked.  This will help users know which form they are viewing/editing.  

 

The buttons are currently configured with 

 

 

OnSelect:    Set(ShowMainForm,true);Set(ShowAddInfoForm,false);Set(ShowStatusForm,false)

 

 

 

TIA

 

1 ACCEPTED SOLUTION

Accepted Solutions
ZabiBabar
Continued Contributor
Continued Contributor

You change the fill and/or color property of the button if the corresponding form is showing.  

If(ShowMainForm, Green, Red)
If(ShowAddInfoForm, Green, Red);
If(ShowStatusForm, Green, Red);

 Put the formula on corresponding button's fill and/or color property. You can change colors however you like. 

View solution in original post

5 REPLIES 5
ZabiBabar
Continued Contributor
Continued Contributor

You change the fill and/or color property of the button if the corresponding form is showing.  

If(ShowMainForm, Green, Red)
If(ShowAddInfoForm, Green, Red);
If(ShowStatusForm, Green, Red);

 Put the formula on corresponding button's fill and/or color property. You can change colors however you like. 

View solution in original post

Hi @ZabiBabar ,

 

If I add to button Color or Fill, I get errors expecting operator + & *  at the semi-colons and commas

ZabiBabar
Continued Contributor
Continued Contributor

Sorry for the miscommunication. You should not add all three formulas to one button. One formula corresponds to one button.

Main Button Fill/Color: If(ShowMainForm, Green, Red)
Additonal Button Fill/Color: If(ShowAddInfoForm, Green, Red);
Status Button Fill/Color: If(ShowStatusForm, Green, Red);

@ZabiBabar - Thank you.  That works.  How do I reference specific colors, like:

 

BLUE RGB:  

0   153   204

 

#0099CC

Button_Name.Color= RGBA(0, 153, 204, 1);

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (3,041)