LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stack controls on eachother?

Solved!
Go to solution

Hello

 

Is there a way to stack controls on eachother, hide the top control, but still have it "detect" the button press?

 

For example, you have 2 buttons, one in the foreground one in the background. The foreground one is placed in the same space as background and made invisible (or hidden).

If you do this with "hide control" function, the foreground one can not be pressed, only background; i want to have it the opposite, when foreground can be pressed but not the background.

0 Kudos
Message 1 of 5
(1,035 Views)
Solution
Accepted by topic author AeroSoul

You can make a button fully invisible still active: start with a flat button in the Classic palette, then make its colors transparent.

What's the role of the background button since it could not be clicked?

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 5
(1,030 Views)

I'm just playing around for now, but the idea was that front button is latch action, while background is switch action.

0 Kudos
Message 3 of 5
(1,026 Views)

You probably don't want to stack controls over each other.

 

One of them will always be "Frontmost" there actually is a Z-Order! You can even change it with the toolbar in edit mode.  Unfortunately,  you cannot change that at runtime.

 

You could try hiding them and changing their positions but that sounds like a hack to me.

 

So, let's clarify the UI Requirements!  Once you write them down a solution will present itself. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,018 Views)

@AeroSoul wrote:

Hello

 

Is there a way to stack controls on eachother, hide the top control, but still have it "detect" the button press?  ...  I want to have it the opposite, when foreground can be pressed but not the background.

Simply make the Foreground Button visible and put it "in front of" the Background Button.  Now you can change which Button "gets pressed" simply by changing the visibility of the Foreground Button.  I've done this in several of my programs.

Bob Schor

0 Kudos
Message 5 of 5
(951 Views)