Jump to content

numeric field without SI abbreviations


Recommended Posts

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

Link to comment

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:

post-253-1147355432.png?width=400

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

Link to comment

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 :blink: , :angry: , :o and enter it again.

Link to comment

@ 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...... :angry:

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.