Board index » delphi » TDateField: EditMask and DisplayFormat

TDateField: EditMask and DisplayFormat

Hi

I have a Problem with TDateField. I have a TDBEdit that displays a
TDateField of a ParadoxTable. The DisplayMask is 'dd.mm.yyyy' and the
EditMask '!90/90/0000;1;'. It shows me the Date correct. But If I Give the
focus to that TEdit to change the Date, the first two numbers of the year
are away.

For Example:
                    first: 12.10.1996
after geting focus:  12.10.__96

It's the German DateFormat.

Can someone Help me?

Stephan

 

Re:TDateField: EditMask and DisplayFormat


St Kraemer wrote in an article appearing in comp.lang.pascal.delphi.databases:

Quote
>Hi
>I have a Problem with TDateField. I have a TDBEdit that displays a
>TDateField of a ParadoxTable. The DisplayMask is 'dd.mm.yyyy' and the
>EditMask '!90/90/0000;1;'. It shows me the Date correct. But If I Give the
>focus to that TEdit to change the Date, the first two numbers of the year
>are away.

There is a global variable called ShortDateFormat which determines the
format of a date when it is edited. It's initial value comes from
LOCALE_SSHORTDATE. On your form's OnCreate method add something like

  ShortDateFormat := 'dd.mm.yyyy';

--
Kevin Davidson (kwdav...@calweb.com)
* "Do not seek your own advantage, but that of the other" 1 Corinthians 10:24

Other Threads