Position or Center a Front Panel Object in LabVIEW

Updated Jan 14, 2026

Reported In

Software

  • LabVIEW

Issue Details

  • I would like to use the Position properties of a Front Panel Control or Indicator to set it's exact position on the Front Panel, but I'm not exactly sure how to use them.
  • Is it possible to center an object on the Front Panel?
  • I would like to center a Control or Indicator on my Front Panel. How can I do this?
  • When I set the Position property of a Front Panel Control to 0, it does not move to the Front Panel's origin. Why does this happen?

Solution

The Position properties for a Front Panel object correspond to its position in the Front Panel window, not on your computer screen.

Setting an object's Position:Top and Position:Left properties to 0 will typically place it slightly above the visible origin in the Front Panel window. This is because (0,0) in the Front Panel is hidden behind the menu bar and toolbar. Placing an object at (0,43) will position it at the visible origin. 

 

This setting persists when running a VI in a dialog box, so an object at (0,43) will still appear at the origin. However the origin also persists when you use the scrollbars in the Front Panel window, so that (0,0) might not always be the correct origin. Use the Origin property, as demonstrated below, to obtain the correct origin.

To position an object at the center of your screen, you should use the Origin and FP.PanelBounds properties to calculate the center of the Front Panel window. Then use the object's Position:Left and Position:Top properties to situate it on the center. See the following example of how to do this.

 
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
 
In LabVIEW 7.1 or earlier, refer to the LabVIEW Documentation for more information about the Position properties. In LabVIEW 8.0 or later, refer to the GObject Properties  topic in the LabVIEW help.