Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ThornOfCrowns
Specialist II
Specialist II

Changing Button Images

Hi All,

I have a question regarding buttons that use a combined image.

We have a dashboard with lots of buttons on it, which programmatically change colour when there's related data. For example, if I click Button1, it sets a variable and Button2 changes colour.

I'm trying to work out a way of doing this with images, i.e. click Burron1 and Button2 changes the image from btnOrange.png to btnBlue.png.

Is this possible or is there a way to do it otherwise?

Thanks.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You probably already guessed that there is no conditional show for button images, or an expression field that decides on which image to show. Just like there isn't any support for changing X/Y/H/W-coordinates of charts and other objects based on the outcome of an expression.

Of course, if you don't like the hidden button-approach, you could always try to solve this programmatically using macros. And as always with macros, your client may decide not to support your solution...

View solution in original post

6 Replies
tresesco
MVP
MVP

May be you can have another set of buttons with btnBlue.png or so and make its appearance conditional(Layout->Show ->Conditional)

Not applicable

Hi,

1. Create button 1 and button 2

2. add action in two buttons for variable value (eg. vVar=0 for button 1 and vVar=0 for button  2

3. Create 2 more text box and load image to each text box( Image 1 and 2)

4. Go to image text box properties > Layout> Conditional show

    For Image1 Text box--------    if(vVar=1,1,0)

    For Image2 Text box--------    if(vVar=0,1,0)

Regards,

Joshmi

ThornOfCrowns
Specialist II
Specialist II
Author

Thanks for your replies, but I was rather hoping not to have to replicate all of fthe buttons.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

You probably already guessed that there is no conditional show for button images, or an expression field that decides on which image to show. Just like there isn't any support for changing X/Y/H/W-coordinates of charts and other objects based on the outcome of an expression.

Of course, if you don't like the hidden button-approach, you could always try to solve this programmatically using macros. And as always with macros, your client may decide not to support your solution...

ThornOfCrowns
Specialist II
Specialist II
Author

Thanks Peter, again I can't use macros. It looks like I'll have to bite the bullet and replicate the buttons.

kji
Employee
Employee

You could use text-objects instead of buttons, with representation set to image and use an expression like:

=if(VariableOrField='Value','image1','image2'), you will however lose the "buttonlook".