From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically reordering controls visually (forward & back) on front panel

Hi
 
I am interested in programmatically moving front panel elements forward and backward visually, just as one would by pressing 'Move forward', 'Move Backward' etc.
 
Is this possible now in 8.5?
 
I already checked out the links dating back to 2000 below:
 
 
(At which point this was apparently not possible.)
 
Thank you for any help!
 
--James
 
0 Kudos
Message 1 of 36
(7,881 Views)
Use the "Position" property nodes to move controls on the front panel.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 36
(7,864 Views)
That will only move the control in the XY coordinates. It will not move the control in the "Z" coordinate, which is the front-to-back order. A check on the LabVIEW Help would have told you this, as well as simply seeing that the individual elements are "Left" and "Top", to indicate X and Y.


Message Edited by smercurio_fc on 04-09-2008 09:17 AM
Message 3 of 36
(7,849 Views)
Ooops I read the question wrong. In that case I  haven't found a way to do that with LV controls, but .NET controls can via their property nodes...
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 4 of 36
(7,844 Views)
There is no way to programatically change the order of items on the Front Panel. Additionally, you should never overlap controls or indicators. Is there any particular reason why you want to do this?  Perhaps there is a different way of accomplishing what you are trying to do.

Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 5 of 36
(7,815 Views)
You can not force one control to be infront of another, however you can set what is visible and not visible.
 
In a lot of my apps when I want to use the same front panel space for multiple controls depending on configuration I simply overlap the controls and then hide what I don't want and show what I do.
 
I am not sure what your use case is but you may be able to mimic it that way.  Another route is to actually draw the info using a picture control, but again it depends on your overall goal.
0 Kudos
Message 6 of 36
(7,805 Views)
Thank you for your input. 
 
I am interested in emphasizing certain controls when they are active by enlarging them slightly, which would cause them to overlap adjacent controls.  I was hoping there was a away to programmatically "bring to front" the control that was active to have it on top of any adjacent controls.  This overlap would be minimal, but desirable... and would only exist during the time the control had focus. 
 
If you are not advising this overlap due to possible flicker during a redraw, this is acceptable given the advantage of the layout. (in testing this was not noticeable)
 
Do you know where thie "z dimension" property is encoded?  I was experimenting with the ordering of controls in the cluster, etc even looking at invoke nodes for the front panel object itself to see if there was something equivalent to a child drawing order, z-axis order etc. but didn't find anything.
 
Thank you!
James
 
0 Kudos
Message 7 of 36
(7,790 Views)
Hi,

I also looked in the the property and invoke nodes of the front panel (as a child) and I was not able to find this property. I would recommend maybe using a border around the control that becomes visible when the control has focus.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 8 of 36
(7,777 Views)

I've also been looking for a way to programmatically set the "Z-Order" of indiviual controls. I finally found an answer, in a form of a brick wall with this message thread.

 

I've looked through all properties and functions with no luck. The LabVIEW Scripting API does not have this property exposed either.

 

I really think this should be a property that should be exposed, since LabVIEW already allows code to modify horizontal and vertical placement of front panel objects.

 

The only workaround I can think of is to: First, lay out a set of controls on the panel with the Z-Order defined. Second, place the visible controls on the VI. Third, when the Z-Order of a visible control needs to be set, programmatically replace that control with a compatible control with the desired Z-Order that was previously laid out.

 

In my application, I would like to allow the user to drag controls around using the mouse. Obviously, there is a problem with unintended overlap without the Z-Order property exposed.

Message 9 of 36
(7,423 Views)
Unfortunately, that's probably the best way of doing this currently.  You can post a suggestion to ni.com/ideas about adding this feature.
Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 10 of 36
(7,367 Views)