Replace Edit Text property. How?

Asked

Viewed 175 times

0

I’m developing a component that’s descended from a TEdit. When calling the application the property Text of this component, I do not want to return what is effectively appearing in the Text component, before I want to mount a new property value Text.
Example: ShowMessage(Componente.Text).
In that case, despite the property Text the component has the value Hello world, I want you to show, for example, the value of the property Hint of the component.

I am doing this because I already have a research component that in the whole system, I use the Text as value for transactions (SQL s and etc.) Now we are modernizing the same, but as the whole system uses it, I need to keep the same way of accessing it, otherwise I will have a gigantic job (almost impossible) to modernize the component.

How to do this?

I hope I was clear.

  • could explain your question better?

  • @Tmc I updated the question.

  • let’s see if I got it right when I do a Showmessage(Component.Text) but no code has to have this way Showmessage(Component.Text))

  • @Tmc That’s right

1 answer

1


I managed to solve.
I created a Text property with Read/Write Gettext and Settext.
In the Gettext make the Result receive the value I want, for example the Hint, and if you want the default value, I Result := Inherited Text;
And in the Settext, I do so: inherited Text := Value;

Browser other questions tagged

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