Click to See Complete Forum and Search --> : Don't want "0" to be displayed in numeric edit box


Twitch
June 1st, 1999, 02:15 AM
Greetings all,

I have an edit box which is set up as a numeric edit box. I would like to know how to display nothing when the value of the control is 0.

Thanks in advance,

Nigel "Twitch" Smith.

Jason Teagle
June 1st, 1999, 02:44 AM
Unfortunately it is the 'numeric edit box' feature which forces the zero in there, since it knows it MUST have at least one digit. I recommend changing to a normal string edit box, deriving from CEdit and subclassing so that you can prevent non-digits, and interpreting the contents as a number yourself. I don't think it is possible to override this behaviour otherwise.