LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programmably change type of button?

Hello! 

 

I want to programmably change the type of button after pressing (using Labview 2015 SP1, Silver pallet).

 

What is the parameter responsible for switching the appearance of the button? I want to have the following sequence:

- in the beginning (during initializing), the button looks like a "record button"

- after the first click it should change appearance to "pause button"

- after the next cleck it should change appearance to "play button"

- any next click cycles between "pause button" and "play button" appearance

 

Is there a parameter to change the icon (only) or type of button in these built-in types of button on the fly?

Or making 3 buttons and later changing their visibility and/or disabling them is the only way?

 

0 Kudos
Message 1 of 11
(1,271 Views)

I believe you can have separate decals for each state?  So TRUE (pressed) = "Pause" decal, FALSE (not pressed) = "play" decal.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 11
(1,239 Views)

Make the button transparent.  Put a picture ring underneath it.

 

(I hate buttons that change their function.  I prefer a separate button for each function)

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 11
(1,218 Views)

@paul_cardinale wrote:

Make the button transparent.  Put a picture ring underneath it.

 

(I hate buttons that change their function.  I prefer a separate button for each function)


It's not really changing it's function if you consider TRUE to select one case and FALSE to select the other.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 11
(1,204 Views)

Can it be changed as "Property Node"? I can't find where

0 Kudos
Message 5 of 11
(1,166 Views)

From what I understand you actually need two buttons, best would be three. and you put them on top of each other.

 

The second one would change the decal between PLAY and PAUSE, that's easy. Or you make one PLAY and PAUSE button and programmatically hide the other one. The first button is also hidden after first push.

0 Kudos
Message 6 of 11
(1,163 Views)

@YePererva wrote:

Can it be changed as "Property Node"? I can't find where


No! You can not change the "decals" programmatically. Most likely this was done on purpose. Decals in LabVIEW are by default not just bitmap images but LabVIEW specific vector objects. There is no easy way to create them yourself.

 

You can custom edit a control and replace the decals with another LabVIEW decal from another control or with a bitmap of your own, but this can only be done interactively and at edit time. If you replace it with a bitmap its scaling gets pretty ugly when you resize the  button since bitmaps are not easy to scale nicely.

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 11
(1,150 Views)

You could also use a picture ring and a "Mouse down" event on it.

0 Kudos
Message 8 of 11
(1,133 Views)

You could put three buttons on different pages of an invisible tab control.

Then change tabs as needed based on which button is pushed.

Simple example attached.

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
0 Kudos
Message 9 of 11
(1,127 Views)

@billko wrote:

@paul_cardinale wrote:

Make the button transparent.  Put a picture ring underneath it.

 

(I hate buttons that change their function.  I prefer a separate button for each function)


It's not really changing it's function if you consider TRUE to select one case and FALSE to select the other.


Belatedly, I realize this is a THREE button solution.  Sorry, Paul.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 11
(1,111 Views)