05-28-2009 04:41 AM
Hi,
How to change the image or text of an Button Dynamically.My application is that,i have one Control Button,by pressing that button,all the text of the button in the or image in the VI should change to the defined image.Please reply me as soon as possible.
Dibya
Enginner
05-28-2009 05:29 AM - edited 05-28-2009 05:30 AM
05-28-2009 06:11 AM
Also take a look here http://decibel.ni.com/content/docs/DOC-4819
You may even use animated gifs. Se example. But I do not know how it impact performance if you have many such controls with animated gifs.

05-28-2009 06:56 AM
Hi Dibya,
LabVIEW provides a way to change the image of the control according to the state.
1) In the advanced menu of the Push Button there is an option called customize.
2) Clicking on this will convert the Push Button into a custom control and opens the editor.
3) Before proceeding further copy the image which you want to apply to the clipboard.
4) In the control editor, pop up on the control and you will find an option called "Import Picture from Clipboard".
5) Using this option you can set the copied image for True or/and False state.
Try this out and let me know if this works out well... 🙂
05-28-2009 07:20 AM
Hi,
First thing i don't want to use customize of the button,can u give me any altenate way.
With Regards
Dibya
05-28-2009 07:29 AM
You can use a Picture control and monitor mouse down in a fashion similar to a boolean. You can put anything you want (and are capable and willing to code) in a picture control (been there, done that). See here for a collection of links to threads with example using the picture control.
If those link inspire you to do something novel and interesting, pleas feel free to post back with your implementation and we can add your example to the collection.
Have fun,
Ben
11-16-2012 02:31 PM
Here's a quick and easy hack:
Drop a button that looks nice. I used Silver/Boolean/Blank.
Place a picture ring on top of it
Drop a transparent button on top of that, and expand it to match. I used Classic/Boolean/Square, then set FG/BG to transparent.
To make it a little nicer, I turned the bottom button into an indicator and connected it to the transparent button. The operator would never know the difference, and the icon can change however often you like.
11-16-2012 04:32 PM - edited 11-16-2012 04:34 PM
You can't change the image dynamically, but you can change the string. Here is an example. I have a raised box decoration, with a transparent picture, and a transparent button on top.
1.) Run the VI
2.) Select the image path for the ON/OFF states.
3.) Enter the message for the ON/OFF states.
4.) Press the button to see how it behaves.
You can change this on the without stopping the VI.