Calling Createparams from an inherited component

Asked

Viewed 38 times

0

I have a component inherited from a Tedit. I already have an override of the 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 the ES_MULTILINE.

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

Is it possible? If yes, how to do?

  • You cannot use the Focused or Mouseinclient control property to do an if there?

  • But how to set these parameters? This is my question. It has how to do some command like SetParams??? Or how to call the CreateParams??? I know it’s possible to call CreateParams by command RecreateWnd, but in doing so Enter control, focus is not the same. - @Tiagorodrigues

1 answer

0


I think this is your problem https://stackoverflow.com/questions/14734419/changing-createparams-dynamically

I will not put the code that is already there in the link but basically is to use 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, do Recreatewnd if the flag is false
  • In the ENTER event, set the flag to true
  • In the EXIT event put the flag back to false
  • I solved my original problem without touching the Createparams, but your solution may be valid for someone else with the same problem. Thank you.

Browser other questions tagged

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