Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
stephenedberkg
Creator III
Creator III

button background color change while clicking

I have the multiple buttons. i want to change the button background color while clicking the button

1 Solution

Accepted Solutions
MayilVahanan

HI

Try some thing like this

Color:

Button1:

=if(vB1 = 1, red(), Green())


Button2:

=if(vB1 = 2, red(), Green())

Action:

Button1:

Varibles: vB1

Value: 1

Button2:

Varibles: vB1

Value: 2

So, when u click first button, its shows red color and second button is in green color.

when u click second button, its shows red color and first button is in green color.


Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
balasundaram
Creator II
Creator II

Hi,

Check button properties->Caption-> Inactive caption and Active caption

MayilVahanan

Hi

Try like this

For button1:

Properties -> General -> Color:

=if(vButton = 1, red(), Green())

Action:

Set Variables

vButton

Value

= 1


Same thing repeat for button 2

=if(vButton = 2, red(), Green()) and so on.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
stephenedberkg
Creator III
Creator III
Author

Dear balasundaram,

yeah it is one way but i don't want to show the caption.i want to change background color only

stephenedberkg
Creator III
Creator III
Author

Dear MayilVahanan

i want to differentiate the clicked button color but it is show the same color

MayilVahanan

Hi

PFA

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
stephenedberkg
Creator III
Creator III
Author

thank you for your reply MayilVahanan

i am using trial version i can't open the QVW file can u send the expression

MayilVahanan

HI

Try some thing like this

Color:

Button1:

=if(vB1 = 1, red(), Green())


Button2:

=if(vB1 = 2, red(), Green())

Action:

Button1:

Varibles: vB1

Value: 1

Button2:

Varibles: vB1

Value: 2

So, when u click first button, its shows red color and second button is in green color.

when u click second button, its shows red color and first button is in green color.


Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
vardhancse
Specialist III
Specialist III

Hi

Button properties->General->Back ground->color->Conditional:

if(vBYORSPP=1,RGB(0,65,101),rgb(255,255,255))

based on the condition/action it will change the color of button