interface
uses
……{略去其他內容}
procedure Table1BirthdayGetText(Sender: TFIEld;
var Text: String;DisplayText: Boolean);
procedure Table1BirthdaySetText(Sender: TFIEld;
const Text: String);
private
{ Private declarations }
public
{ Public declarations }
……{略}
implementation
{將自定義的單元包含進來}
uses DBDateEditMaskTrans;
{$R *.DFM}
……{其他過程略}
procedure TForm1.ForMactivate(Sender: TObject);
{設置一個日期型字段的輸入掩碼,
可以放到TFIEld字段定義中。}
begin
Table1.FIEldByName('Birthday').EditMask:=
'9999年99月99日;1;_';
end;
procedure TForm1.Table1BirthdayGetText(Sender:
TFIEld; var Text: String;DisplayText: Boolean);
begin
DateFIEldGetText(Sender,Text);
end;
procedure TForm1.Table1BirthdaySetText(Sender:
TFIEld; const Text: String);
begin
if DateFIEldSetText(Sender,Text)=False then
Abort; {轉換不成功,日期非法}
end;