cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichaGue
Resolver I
Resolver I

Change Fill color when text input is selected

Hello,

 

is it possible to configure the following properties on text input?

 

2022-01-26_13h17_35.png

 

The first three (default, hover and pressed) are no problem. But how can I implement the fourth one? Selected means, when the input field is selected, the text field should appear light blue.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
AmDev
Super User
Super User

Hi @MichaGue 

 

You can use a variable to control the fill colour along with the 'OnSelect' property of the field

 

In the 'OnSelect' property of say TextInput1 add the following

Set(varSelected, 1)

 

Then in the Fill property of the TextInput1 add this

If(varSelected = 1, YourSelectedColour, DefaultColour)

 

Note, if using this approach on multiply textinput fields, you will need to assign a unique variable for the onselect of each control.

 

When a user completes a field and then clicks to the next field, that should change the variable and change the selected fill to the now selected field only. Though make sure to clear the variable at the right time so that no fields are showing the selected fill when they shouldn't be i.e. when you submit your data add the following:

Set(varSelected, Blank())

 

Hope this helps

View solution in original post

1 REPLY 1
AmDev
Super User
Super User

Hi @MichaGue 

 

You can use a variable to control the fill colour along with the 'OnSelect' property of the field

 

In the 'OnSelect' property of say TextInput1 add the following

Set(varSelected, 1)

 

Then in the Fill property of the TextInput1 add this

If(varSelected = 1, YourSelectedColour, DefaultColour)

 

Note, if using this approach on multiply textinput fields, you will need to assign a unique variable for the onselect of each control.

 

When a user completes a field and then clicks to the next field, that should change the variable and change the selected fill to the now selected field only. Though make sure to clear the variable at the right time so that no fields are showing the selected fill when they shouldn't be i.e. when you submit your data add the following:

Set(varSelected, Blank())

 

Hope this helps

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,286)