Search code examples
delphifiremonkeycaret

How do I hide the caret from a TEdit in Firemonkey?


Well, that's pretty similar to this question.

But

HideCaret(YourAwesomeTEdit.Handle);

seems not to be available for Firemonkey. I can't figure out how to use the same function, or even something that would achieve the same effect would be nice for the iOS app.

How do I hide the caret from a TEdit in Firemonkey?


Solution

  • The TEdit has a caret property which you can set the visible property to false.

    edit1.caret.visible:= false;
    

    I don't recommend this however in your situation, as then you need to remember to re-enable it.

    Also it's not clear what you mean by the 'done button' on the keyboard. Are you running on mobile? If so, then you can simply set the KillFocusByReturn property to true, and then the caret will automatically disappear and focus shifts to the form after the keyboard closes.