cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JC75
Level: Powered On

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.

hpkeong
Level 10

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.

 

Screenshot (412).pngLoop, with unlimited Click; change as you wish!

 

Have a nice day.

Good nite.

hpkeong

View solution in original post

JC75
Level: Powered On

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

That’s perfect thank you 

PytByt
Level 8

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

Justair07
Level: Powered On

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

Justair07
Level: Powered On

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

Corbie
Level: Powered On

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.

Justair07
Level: Powered On

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

@Corbie your syntax error would be helpful 🙂

Highlighted
Corbie
Level: Powered On

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.

 

 

stapes
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,974)