Asuran

Hi guys, I am new in c++ and Visual c++ and I'd like know how i can restrict my textbox to number. The user can only write number( int or float) in textbox. help pls

Thanks for atenttion



Re: Visual C++ General How can i restrict textbox to number?

Sdi

You might start with the CParsedEdit class in the CTRLTEST sample.





Re: Visual C++ General How can i restrict textbox to number?

Charry

Open the propertys dialog for your editbox and check 'Number' in the 'Styles' tab



Re: Visual C++ General How can i restrict textbox to number?

Sdi

I'm not sure that will work for the stated requirement "int or float". ES_NUMBER restricts typed input to digits, which may be too restrictive for "float". Also, ES_NUMBER doesn't prevent Edit.Paste of non-numeric text.