Hiding Delphi null field mask

Asked

Viewed 87 times

0

I have a Dbtext field with phone information, I formatted the field that way "! 99999-9999;1;_", only when a null field appears, it ends up displaying the hyphen that separates the numbers, it has some way to disappear with this character, when the field is null?

1 answer

0

Use the event OnSetText:

procedure TDM.cdsCadClientesFONESetText(Sender: TField; const Text: string);
begin
  if Text = '     -    ' then
    Sender.AsString := ''
  else
    Sender.AsString := Text;
end;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.