Forum > LCL

TCustomEdit Text:=Name of component

(1/1)

99Percent:
I am trying to make my own TCurrencyedit component and so far I have succeeded. My only gripe right now is that when setting the component in the form it assigns the name of the component to the Text property, which is obviously invalid in a numeric context.

I cannot find where this is done or how to disable it. Please help.

Lazarus 0.92.9 FPC 2.4.3 SVN 26610 Windows XP.

typo:
Well, you can set your own value of Text property on the constructor of your class.

99Percent:
I have:

--- Code: ---constructor TSCurrEdit.Create(AOwner: TComponent);
begin
  inherited Create (AOwner);
  FormatStr:= '%m';
  Value:=0.0;
  Text:='$0.00';
  Alignment:= taRightJustify;
end;   

--- End code ---
But the Text assignment doesn't work, it still gets the 'SCurrEdit1' as its default Text

Leledumbo:
You may want to know how Fshcomp does this.

Navigation

[0] Message Index

Go to full version