web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Change the background ...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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,

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    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"}).

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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 ?

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @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

     
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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 ?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard