Creating a Dialog Box

Use the Display Message to User Express VI or the Prompt User for Input Express VI to display a standard dialog box that contains an alert or a message to users or prompts users to enter information, such as a user name and password.

Tip  To keep from overusing dialog boxes, use a status text window to display less serious warnings or messages.

Complete the following steps to create a custom dialog box that looks like a standard dialog box across all platforms.

  1. Select File»New to display the New dialog box, which lists all available built-in template VIs.
  2. Select the Dialog Using Events template to assist in building dialog boxes. The template contains front panel and block diagram objects commonly used in dialog boxes.
  3. Click OK to close the New dialog box and open the custom dialog box for you to edit.
  4. Use the following guidelines while building the front panel and block diagram of the VI.
  5. Assign key navigation for the front panel controls. Assign <Enter> for the OK button, <Escape> for the Cancel button, and <F1> to the Help button.
Note  Do not assign <Enter> for the OK button if the front panel has multi-line string controls.
  1. Reduce the front panel window size to show only the objects you want to appear in the dialog box.
  2. Set the front panel window appearance as Dialog and enter a title for the dialog box title bar.
    1. Select File»VI Properties and select Window Appearance from the Category pull-down menu of the VI Properties dialog box.
    2. Select the Dialog option.
    3. Remove the checkmark from the Same as VI Name checkbox in the Window Title section to create a custom title that appears in the dialog box title bar. Enter the dialog box name in the field next to the checkbox.
    4. Click the OK button to save the changes and close the VI Properties dialog box.