brunotoira Posted June 2, 2014 Posted June 2, 2014 Hello, I need to setup UniEdit to accept only chars: 0..9 and "," Backspace and "-" to negative numbers. i create this function, but if i press "." (point) doesnt change to "," (comma) Anyway to do this? procedure TDataModule1.AllowedChars(Sender: TObject; var Key: Char); begin If sender is TUniEdit then Begin if charinset(Key,[backspace, '0'..'9'])=True then exit; if ((Key = '.')OR(Key = ',')) and (Pos(',', TUniEdit(sender).Text) = 0) {and (TUniEdit(sender).s <> 0)} then BEGIN KEY:=','; exit; END; if (Key = '-') {and (TUniEdit(sender).SelStart = 0)} and (pos('-',TUniEdit(sender).text)=0) then exit; Key := #0; end; end; Quote
Administrators Farshad Mohajeri Posted June 2, 2014 Administrators Posted June 2, 2014 TuniNumberEdit 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.