user5784310
user5784310

Reputation:

Check whether a string from an edit box contains a CHAR value - Delphi

I have a timetabling program I'm working on for my project and I'm working on adding error messages, I have a form with 5 edit boxes, entering values in this field update the times shown next to the periods on the timetable program (think like 06:45-08:45 and next one down says 09:00-11:00). I've stopped from someone entering a too long a string like 'OMGISTHISATEXTBOX'.

I'm trying to work out a way from showing an error message when the user enters anything with a char (letter), or not allow anything but integers and a hyphen symbol and a colon (-,:). I assume not allowing char values is easier, but doing the latter if possible would be amazing.

Many thanks for your help and hope this makes sense, if you need more info lemme know

-Adam

Upvotes: 0

Views: 518

Answers (1)

MBo
MBo

Reputation: 80232

There are special components for these purposes:

TMaskEdit is intended for input restricting.

For time input you can use also TDateTimePicker

Upvotes: 6

Related Questions