Enforcing numbers only in a text edit box – Delphi

With the calculator program I created earlier, one of the concerns is that a user is able to type in a letters into the text edit box instead of only being allowed to type in numbers.

How does one overcome this issue?

In the Object Inspector, set the property ‘NumbersOnly‘ (for the edt object) to True. This ensures that only numerical data can be inputted and no program errors will occur when calculating.


Be the first to comment