LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ho to change the image of a Button Dynamically?

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

 

0 Kudos
Message 1 of 8
(12,176 Views)
Hi Dibya, changing texts of boolean buttons is possible with property nodes. You can change captions, tip strips, and text on button (property strings[4])... What is an Enginner? A combination of engineer and beginner? Smiley Wink edited: WTH is happening here? In the preview I have linefeeds, in the post I get block text???
Message Edited by GerdW on 05-28-2009 12:30 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(12,167 Views)

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.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 8
(12,158 Views)

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... 🙂

Message 4 of 8
(12,146 Views)

Hi,

    First thing i don't want to use customize of the button,can u give me any altenate way.

 

With Regards

Dibya

0 Kudos
Message 5 of 8
(12,130 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(12,122 Views)

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.

___________________
CLD, CPI; User since rev 8.6.
Message 7 of 8
(10,934 Views)

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.

 

Front Panel.png

 

 

Download All
0 Kudos
Message 8 of 8
(10,922 Views)