cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Change the background of a text with I click on a icon

Hi !

I want to change the background of a text ( yellow ), when I click on a icon. But I really don't know how to do it, I'm new to powerapps. 

Thanks,

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Change the background of a text with I click on a icon

@Anonymous 

It depends on what you are trying to change the color of.  I would recommend using the RGBA() function for setting colors and fills.

Yellow is RGBA(255,255,0,100), White is RGBA(255, 255, 255, 1).  To set the default fill color of a control on a screen, click on the screen and select the OnVisible property.  Put UpdateContext({var: RGBA(255, 255, 255, 1)}) in this property.  Put a label on the screen and set it's Fill property to var.  Put a button on the screen and set its OnSelect property to  UpdateContext({var: RGBA(255,255,0,100)}).  default screen.pngdefault screen button press.png

 

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Re: Change the background of a text with I click on a icon

Hi @Anonymous 

Use a context variable in your button's OnSelect property as UpdateContext({var:"Yellow"}) and set the Fill property of the label to var.  To set the default fill to White for example, in the OnVisible property of the screen containing the button UpdateContext({var:"White"}).

Highlighted
Anonymous
Not applicable

Re: Change the background of a text with I click on a icon

So I need to do three changes right ?

Two for the button and for the text.

 

-UpdateContext({var:"Yellow"}) on the select part of the button 

-UpdateContext({var:"White"}) on the onvisible part of the button

- var on the fill part of the text ?

 

Highlighted
Super User III
Super User III

Re: Change the background of a text with I click on a icon

@Anonymous 

It depends on what you are trying to change the color of.  I would recommend using the RGBA() function for setting colors and fills.

Yellow is RGBA(255,255,0,100), White is RGBA(255, 255, 255, 1).  To set the default fill color of a control on a screen, click on the screen and select the OnVisible property.  Put UpdateContext({var: RGBA(255, 255, 255, 1)}) in this property.  Put a label on the screen and set it's Fill property to var.  Put a button on the screen and set its OnSelect property to  UpdateContext({var: RGBA(255,255,0,100)}).  default screen.pngdefault screen button press.png

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Change the background of a text with I click on a icon

When i put var on the fill property of the text, it becomes black, but yes, when I click on the icon, indeed it changes to yellow, Also, thank you very much. Do you know how can I fix this ?

Highlighted
Anonymous
Not applicable

Re: Change the background of a text with I click on a icon

Nevermind, I dont know how I did it, but it works, thanks !

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,431)