![]() |



Function |
Declared in: NiNumEditEvents.h |
Declaration
void OnValueChanging( VARIANT FAR* NewValue, VARIANT FAR* AttemptedValue, VARIANT FAR* PreviousValue, BOOL OutOfRange);
Description
Generated when the value of the numeric edit control is about to change. That is, the value of the control has been entered but not set.
Note: Modify thenewValue parameter within your event handler to change the value that is set in the numeric edit control.
Parameters
Contains the new value for the control.
Note: If you alter the value of this parameter within your event code, the numeric edit control is set to this altered value.
Contains the value that the user tried to set in the control.
Notes:
1. You should use this value to construct a CNiVariant to get to the variant's data.
2. This is often the same as the newValue parameter, and is most useful for custom range checking or validation.
Contains the previous value of the numeric edit control.
Note: This parameter should be used to construct a CNiVariant to get to the variant's data.
Contains true if newValue is not within the range specified by the Minimum and Maximum properties of the numeric edit control.
See Also
Example
void OnValueChanging (VARIANT FAR* NewValue, VARIANT FAR* AttemptedValue, VARIANT FAR* PreviousValue, BOOL OutOfRange) { double Tmp = CNiVariant(NewValue); // New value outside the range 0-100? if (Tmp < 0 || Tmp > 100) { // Set the value to 50 *NewValue = CNiVariant(50); } }