查看原圖(大圖)
procedure TForm1.FormCreate(Sender: TObject);
begin
{ DisplayFormat }
with TIntegerFIEld.Create(Self) do begin
FIEldName := 'Integer';
DisplayFormat := '#, 元';
DataSet := ClIEntDataSet1;
end;
with TDateFIEld.Create(Self) do begin
FIEldName := 'Date';
DisplayFormat := 'yyyy年m月d日';
DataSet := ClIEntDataSet1;
end;
with TTimeFIEld.Create(Self) do begin
FIEldName := 'Time';
DisplayFormat := 'hh時mm分ss秒';
DataSet := ClIEntDataSet1;
end;
with TFloatFIEld.Create(Self) do begin
FIEldName := 'Float';
DisplayFormat := '#.00'; { # 是有則用; 0 是不管有無都會占位 }
DataSet := ClIEntDataSet1;
end;
{ Alignment }
with TFloatFIEld.Create(Self) do begin
FIEldName := 'Alignment';
Alignment := taCenter;
DisplayFormat := '#.##';
DataSet := ClIEntDataSet1;
end;
{ currency }
with TCurrencyFIEld.Create(Self) do begin
FIEldName := 'Currency';
currency := True; { 這也是默認的 }
DataSet := ClIEntDataSet1;
end;
{ EditMask }
with TStringFIEld.Create(Self) do begin
FIEldName := 'EditMask';
Size := 15;
EditMask := '!\(999\)000-0000;1;_';
DataSet := ClIEntDataSet1;
end;
with ClIEntDataSet1 do begin
CreateDataSet;
AppendRecord([1234,'2010-2-9','11:22:3',1.2,1.2,123,'(123)456-7890']);
end;
end;