Example Code

Custom Error/Warning Dialog with Selectable Icon

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 example VI emonstrates how to customize error popup dialog boxes in LabVIEW.


Description
When creating dialog boxes to inform users of various events, it is often useful to display a warning or error image to indicate the severity of the issue.  This VI dynamically displays a chosen Icon, message, and icon.  it also will handle the error wired in if no message text is wired in. The VI outputs the index of the button clicked - 0 for the close "x", 1 for the first button on the left, etc. 

Unlike the shipping dialog VI's, this one is fully editable, allowing you to customize it further for your own applications.  Also, more Icons can be added - the icons are all contained in an image ring control.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached files to your computer
  2. Open the VI "Error Dialog Customization LV2012 NI Verified.vi"
  3. Expand the fron panel and modify the hidden controls
  4. Run the program
  5. Click OK to close the popup window

 

Additional Information or References

VI Block Diagram

Error Dialog Customization LV2012.png

 

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

Al B.
Staff Software Engineer - TestStand
CTA/CLD

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