Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
1 ratings:
 5 out of 5   

How Can I Programmatically Prevent Resizing of the Front Panel?



Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 2014
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: I want to be able to programmatically prevent users of my application from resizing the front panel of either my current VI or a SubVI. How can I implement this functionality?

Solution: Preventing resizing in a VI  can be accomplished using property nodes, as shown in the VI snippet below:

  1. Add an Open VI Reference to the block diagram by right-clicking the block diagram and selecting Functions»Programming»Application Control»Open VI Reference.
  2. Add a Current VI's Path VI found in Functions»Programming»File I/O»Constants»Current VI's Path and connect it to the path input of the Open VI Reference VI.
  3. Right-click on the VI Reference terminal and select Create»Property Node for VI Class»Front Panel Window»Resizable.
  4. Right-click the FB.Resizable text and select Change to Write.
  5. Right-click the FB.Resizable terminal and select Create»Constant.
  6. Add a Close Reference to the block diagram by right-clicking the block diagram and selecting Functions»Programming»Application Control»Close Reference.
  7. Wire the VI as shown above.
If you plan to create an executable program based on this VI, you will need to replace the Open VI Reference with the VI Server Reference.  This function simply references the application it is located in.  This is necessary for executables since there is no VI to reference.  



Related Links: Knowledgebase 3VEGHFQG: How Can I Resize the Front Panel of a VI Programmatically? Knowledgebase 209DQQ7Z: How Do I Create Attribute Nodes and Property Nodes?

Attachments:
PreventPanelResize.vi




Report Date: 03/10/2015
Last Updated: 04/14/2015
Document ID: 6V9G23Q7

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit