在设计时用固定字段,在sex字段的OnGetText和OnSetText事件中写代码
procedure TDMForm.ADS_DJ_FPFPLYGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
case Sender.Asboolean of
true:Text:='男';
false:Text:='女';
end;
end;
procedure TDMForm.ADS_DJ_FPFPLYSetText(Sender: TField; const Text: String);
begin
if Text='男' then
Sender.AsBoolean:=true
else
if Text='女' then
Sender.AsBoolean:=false;
end;