Calling CreateParams of an inherited component

0

I have a component inherited from a TEdit . I already have an override of CreateParams and by default it has the following parameters:

Params.Style := Params.Style or WS_CLIPCHILDREN or ES_MULTILINE or ES_AUTOHSCROLL;

But sometimes, I would like to change these parameters by removing ES_MULTILINE .

Specifically, in the Enter of the component, I would like to add the ES_MULTILINE , and in Exit I would like to remove it.

Is it possible? If so, how?

    
asked by anonymous 27.09.2017 / 16:28

1 answer

0

I think this is your problem link

I'm not going through the code that is already in the link but basically it is using RecreateWnd but with a boolean flag to control the number of times it is called.

  • Create a flag in your class
  • In the ENTER event, make the RecreateWnd if the flag is false
  • In the ENTER event, set the flag to true
  • In the EXIT event, return the flag to false
27.09.2017 / 22:44