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

Notifications

Announcements

Community site session details

Community site session details

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

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

(0) ShareShare
ReportReport
Posted on by

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
    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
    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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard