Ian Branch 127 Posted August 19, 2021 Hi Team, ATT I use this routine in the OnKeyPress of the TDBEdit to limit the data entry to only numbers. // #8 is Backspace if not (Key in [#8, '0'..'9']) then begin MessageBeep(MB_ICONERROR); TaskMessageDlg('Invalid data entry!', 'Only numbers are allowed for the Service #.', mtError, [mbOK], 0); // Discard the key Key := #0; end; // Unfortunately this does not allow cut & paste of a number. How can I facilitate cut & paste a number with leading or trailing spaces, without losing the numeric control? I have tried using MaskEdit but it still allows the pasting of the number with leading or trailing spaces. :-( Regards & TIA, Ian Share this post Link to post
corneliusdavid 214 Posted August 19, 2021 Use TRzDBNumericEdit to save yourself some time. Share this post Link to post
Ian Branch 127 Posted August 19, 2021 Yup. I have. Hence my other question. Thanks & Cheers. Ian Share this post Link to post
Fr0sT.Brutal 900 Posted August 19, 2021 Why not catching OnChange? Input could be done by many different ways - by mouse, with SendMessage, etc. Share this post Link to post