Joernh Posted May 11, 2006 Report Share Posted May 11, 2006 Hi everybody, i have some problems with numeric fields. I dont't want it to accept any characters, but whatever i've done, it was possible to type in the abbreviations for the SI-prefixes (like k for kilo). :headbang: Does somebody knows how to resolve this? Regards Joernh Quote Link to comment
didierj Posted May 11, 2006 Report Share Posted May 11, 2006 I'm not aware that there is any setting that could disable it, but you can do it "by hand" and using the event structure: With char you get the ascii representation of the typed key. 44 = comma 45 = minus 46 = point (as decimal, depends on the computer "local settings") 48-57 = values 0..9 maybe you need more, eg. for <ENTER>. Didier Quote Link to comment
Phillip Brooks Posted May 11, 2006 Report Share Posted May 11, 2006 Could you set the Data Range for the control? I personally like the flexibility of entering 25M instead of 25000000. If your users are "fat-fingering" the value and the range is limited, use Data Range and coersion on the control. If they enter 79k and the range is -100 to 100, then value will change to 100 and they will , , and enter it again. Quote Link to comment
Joernh Posted May 11, 2006 Author Report Share Posted May 11, 2006 @ didierj thx, that's a good idea!! @ Phillip Brooks maybe i have to deal a little, but right now they don't like accepting characters by the numerics...... To set the data range is not the solution, because for my app it's definitely not good to coerce a value to any limit. Therefore i check the range "manually" in an eventhandler. If the value is out of range, i show a messagebox and then set the numeric to the old value. Regards Joernh Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.