Example Code

Programatically Center Front Panel Object Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI demonstrates how to programmatically center an object on the front panel based on the window's size. 

 

Description

This VI takes the size of the window and then positions the Object in the middle of the coordinates. It is really a demonstration of how you could build this into your own code. You can then create your own positioning, playing around with the coordinates, and place additional objects.

 

Requirements

LabVIEW Full Development System 2012 or compatible

 

Steps to Implement or Execute Code

  1. Run the VI
  2. Observe the Waveform Graph centered on the front panel
  3. To stop the VI, Press the stop button 

Additional Information or References

VI Block DiagramProgrammatically Center Front Panel Object Using LabVIEW  BD.jpg

 **This document has been updated to meet the current required format for the NI Code Exchange. **

 

ColeR
Field Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Todd S.
NI Employee (retired)
on

Thanks for posting!

Todd S.
LabVIEW Community Manager
National Instruments
cha@bellflight.com
Member
Member
on

If I have a group of objects, it would be tedious to repeat the same "Waveform Graph" procedure to center each object. Is there a better way ?

 

Regards,
cha@bellflight.com