Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Can I Control the Location of a Dialog Window in LabVIEW?

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

Problem:
LabVIEW provides several useful native VIs for communicating with a user by means of a pop-up window (i.e. one, two, and three button dialog).  However, by default, these dialog windows emerge in the center of the VI which calls them.  This default behavior can often hide controls and/or indicators that would be useful in appropriately responding to the given prompt.  As such, how can the location of this window be controlled to best suit the application?


Solution:
Although LabVIEW does not provide any direct means of controlling this location, there is one approach to achieving this functionality:
    1. Place the appropriate dialog VI in a separate VI.
    2. Use a VI Server Reference with a Property Node to set the properties of this VI to be frontmost, invisible, as small as possible to encompass the dialog, and in the desired position. See the attached examples below for more details.
    3. Select File » VI Properties, the Window Appearance Category from the drop down, the Customize... button, and check the Show front panel when called and Close front panel if originally closed checkboxes.
    4. Save this VI and call it from the original application in place of the dialog VI.
Attached are two VIs that accomplish this very process. DialogXY.vi is the subVI that contains a two button dialog VI. Example.vi makes a call to this subVI and designates the desired location of the dialog window in terms of x and y coordinates.

Related Links:
KnowledgeBase 3IF9AP0K: Error When Trying to Set the Front Panel Window Bounds Using a Property Node

Attachments:
DialogXY.vi
Example.vi




Report Date: 09/03/2008
Last Updated: 09/12/2008
Document ID: 4P2DRU8Z

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