Jump to content

Edit and Display Mask


mierlp

Recommended Posts

Hi,

 

Within my apps i use MyDac components voor database access and so

also the query components.

 

The query components contains the fields and is use 2 time fields

On a field it's possible to set the DisplayMask (HH:mm) for time

and EditMask (99:99)

 

Then i use the OnSetText event for this field with the following code:

 

procedure TdmArtist.ArtistStageTimeStartSetText(Sender: TField;
 const Text: string);
begin
 if trim(Text)=':' then
   Sender.Clear
 else
 try
   Sender.AsDateTime:=StrTotime(Text);
 except
   // custom message when the time is invalid
   raise exception.Create('"'+text+'" is not a valid time or time format!');
 end;
end;

 

Normally on standard Delphi applications it works. With uniGui i dont get

the display/edit mask on a uniDBEdit component.

 

How can i create a edit mask for time and check if it's a

valid entered time.

 

Regards Peter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...