cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate IV
Advocate IV

Re: How do you turn a button into a different colour when its pressed?

Thank you - that’s a useful example with the timer, however think you missunderstood my request.

 

what I meant was that in your original example, it’s a toggle, so only swaps between two colours each time button is pressed. What I want is that on first click it goes amber, second click red, third click back to green. But remains each colour until clicked, not a cycle through all colours in one go. So having items that can have 3 states rather than just simple true or false.

Highlighted
Community Champion
Community Champion

Re: How do you turn a button into a different colour when its pressed?

Hi @JC75

 

Yup, looks like my understanding for English still needs more improvement.

(Maybe I always used to translate in my mind into Chinese when reading).

 

The best and most useful syntax used in PowerApps;

- UpdateContext

- x = x+1 (widely used in any programming languages for Looping purposes

- Switch (If is another alternative, but longer codes)

 

Here it is the final sample and hope this time I have understood your messages.

 

Loop, with unlimited Click; change as you wish!Loop, with unlimited Click; change as you wish!

 

Have a nice day.

Good nite.

hpkeong

View solution in original post

Highlighted
Advocate IV
Advocate IV

Re: How do you turn a button into a different colour when its pressed?

That’s perfect thank you 

Highlighted
Post Prodigy
Post Prodigy

Re: How do you turn a button into a different colour when its pressed?


@hpkeong wrote:

Hi

 

Each button has many variable for you to control:

- PressedFill

- PressedColor

You can make changes over the color as you wish.

 

TQ


where am i supposed to do this? please help, im a noob in powerapps

Highlighted
Helper I
Helper I

Re: How do you turn a button into a different colour when its pressed?

@hpkeong I can't see what I'm doing wrong. But it looks like Switch isn't working. The color does not change.

OnSelect.JPGFill.JPG

Highlighted
Helper I
Helper I

Re: How do you turn a button into a different colour when its pressed?

For anyone else having an issue, I found another solution that works great

colChange.JPG

Highlighted
Helper I
Helper I

Re: How do you turn a button into a different colour when its pressed?

Hello,

 

Did they change anything in this few years? 

 

When i wanna do "UpdateContext({x: x+1});"

 

im getting syntax error.

 

Btw why everyone post images with code instead of copy it here?....

 

Thanks for answers.

Highlighted
Helper I
Helper I

Re: How do you turn a button into a different colour when its pressed?

@Corbie your syntax error would be helpful 🙂

Highlighted
Helper I
Helper I

Re: How do you turn a button into a different colour when its pressed?

@Justair07 

Hello,

 

Sry i figure it out.

 

it was cause of different language in browser.

 

Thanks for answer anyway.

 

 

Highlighted
Post Patron
Post Patron

Re: How do you turn a button into a different colour when its pressed?

My colours are not updating. Is that because I am using a global variable instead of a context variable? Context variable is too limited as I want to pass this value between screens.

    If(daySelected = 2, Color.White, RGBA(255, 255, 255, 1))

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,748)