numeric TEdit

How can I make sure that I can only write numbers in a TEdit component of the VCL?

Thanks!
Use a TMaskEdit, and specify an EditMask property. (I have only used the VCL in Delphi, so you will have to read the documentation to see how to set it using C++.)

Good luck!
Thank you! And now... If I want to combine not e TEdit but a ComboBox with this MaskEdit? I want to have some prefixed options and being able to write down some other ones (but only numbers)... Thank you anyway.
Ah. Alas, there are no pre-defined TMaskComboBox controls... you would have to roll your own.

(It isn't too difficult, google around "custom component vcl" and the like.) Sorry this isn't more helpful. You might want to find a BDS C++ forum for more help. TekTips comes to mind.)

Good luck!
Topic archived. No new replies allowed.