Overview
This is a simple example where the color of a color numeric control changes according to the numeric value on a dial.
Description
This example makes use of an EVENT_COMMIT callback on a dial. We use the GetCtrlVal function to determine what value is stored in the dial. Using this and a simple 'if' statement, we use the MakeColor function to dictate what color will be displayed on the color numeric control. See the following resources for additional information:
http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/uiref/cvicolor_numeric_control_overview/
http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvimakecolor/
http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cvisetctrlval/
Steps to Implement or Execute Code
Requirements
Software: CVI 2012 (or later)
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.