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.
- Select File»New to display the New dialog box, which lists all available built-in template VIs.
- 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.
- Click OK to close the New dialog box and open the custom dialog box for you to edit.
- Use the following guidelines while building the front panel and block diagram of the VI.
- 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.|
- Reduce the front panel window size to show only the objects you want to appear in the dialog box.
- Set the front panel window appearance as Dialog and enter a title for the dialog box title bar.
- Select File»VI Properties and select Window Appearance from the Category pull-down menu of the VI Properties dialog box.
- Select the Dialog option.
- 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.
- Click the OK button to save the changes and close the VI Properties dialog box.