Re: Formatting output of TDBEdit
- From: "Mikael Lenfors" <mikael@xxxxxxxxxx>
- Date: Sun, 28 Oct 2007 18:21:16 +0100
Ok, thanks. Used it to implemet the following:
ADOQuery.FieldByName('TestField').OnGetText := HideZeroValues;
Procedure MyForm.HideZeroValues(Sender: TField; var Text: string;
DisplayText: Boolean);
Begin
If Sender.AsFloat = 0 Then
Text := ''
Else
Text := FloatToStr(RoundTo(Sender.AsFloat, -2));
End;
Works perfectly except for one thing, it's not called until i click on or
tab to the TDBEdit that is linked to the field. I have tried all sorts of
Refresh and Repaint but cant make it use the OnGetText until I go to the
DBEdit.
Any ideas?
regards, Mikael
"Alfred ten Hoeve" <Al@xxxxxxxxxx> skrev i meddelandet
news:4723c860@xxxxxxxxxxxxxxxxxxxxxxxxx
"Mikael Lenfors" <mikael@xxxxxxxxxx> schreef in bericht
news:47238743@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello!
In my objects of type TDBEdit I want to present a blank string if the
value is 0. How do I do this? The objects are mapped to a datasource and
fields with an integer or real values.
regards, Mikael
See OLH. Topics OnGetText and OnSetText event for the field.
Alfred.
.
- Follow-Ups:
- Re: Formatting output of TDBEdit
- From: Alfred ten Hoeve
- Re: Formatting output of TDBEdit
- References:
- Formatting output of TDBEdit
- From: Mikael Lenfors
- Re: Formatting output of TDBEdit
- From: Alfred ten Hoeve
- Formatting output of TDBEdit
- Prev by Date: Re: Stored proc timeout issue
- Next by Date: Re: Formatting output of TDBEdit
- Previous by thread: Re: Formatting output of TDBEdit
- Next by thread: Re: Formatting output of TDBEdit
- Index(es):