Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

MessageBox in CNINumEdit OnValuChanging Event

I met a problem .if the statement exists in the "if(OutOfRange){} "function ,two messagebox appears when the user input is out of range.
if the statement does not exsist ,the statements in the "if(OutOfRange){}" only excute once.I am quite confused,can anyone help me .
0 Kudos
Message 1 of 2
(2,838 Views)
Gonnago1,

I tried this out in VC++ and didn't see the same behavoir. On the CWNumEdit control on the form, I set the Numeric tab to have a range between 0 and 2 and did NOT check the "Do Range Checking" checkbox. Then in the OnValueChangedCwnumedit1 event, I added the following code:
if(OutOfRange)
MessageBox("OUTOFRANGE", NULL, MB_OK);
else
MessageBox("NOT OUTOFRANGE", NULL, MB_OK);

When I run this, I change the value of the NumEdit control and I only see 1 messagebox each time the value is changed. The messagebox correctly identifies whether the value is in the range or not.

If you continue to have problems, please post back with the versions of the software that you are using and perhaps some example code.

Regards,

Shannon R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,838 Views)