Alessandro Posted December 14, 2015 Posted December 14, 2015 Hello everyone! I'm trying to use the keyPress DBEdit, but is not working. In a DBEdit, I have to create a formula (using parser.pas), but want the user to only enter numbers and some specific letters, the formula. I tried to do the following below, but is not working. procedure TForm.UniDBEdit1KeyPress(Sender: TObject; var Key: Char); begin // + - * / ^ [ ] ( ) if not (Key in ['0'..'9','Q','P','V', 'L','D', 'M', #43, #45, #42, #47, #94,#91, #93, #40, #41, #8]) then begin key := 0; <-- error char vs string //Key := chr('0'); <-- dont work end; end; When the letter that is not present in the function, it is accept by the procedure and allows inclusion in Edit. Can anyone help? Thanks. Quote
Abaksoft Posted January 10, 2016 Posted January 10, 2016 See :http://forums.unigui.com/index.php?/topic/3495-how-only-number-in-tunidbnumberedit-not-double-is-it-possible/&do=findComment&comment=16284 Quote
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.