Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1445

Checking KeyPress is not the place to do your input validation

$
0
0

I have seen too many projects over the years trying to do input validation by checking KeyPress. This is not limited to Delphi projects (C#, VB and other projects suffer from this just as much). Most of these projects suffer from these::

  • Much of the KeyPress logic logic in the UI byusing half-baked copy-pasted code fragments.
  • They all fail missing important functionality (like paste, clear, Ctrl-key handling and such) either supporting or suppressing that functionality where needed

If doing Delphi, then that code should be rewritten in a generic way based on examples like like these:

–jeroen


Filed under: .NET, Delphi, Development, Software Development, Windows Development

Viewing all articles
Browse latest Browse all 1445

Trending Articles