5

Is there any way to add a placeholder text to an edit?

My only idea is to always manually set the color and the text of the given edit in its OnChange event, but it seems to be a bit tedious to me.

Any other suggestions?

Abdullah Ilgaz
  • 719
  • 1
  • 17
  • 39
Oh nooo
  • 478
  • 5
  • 19

2 Answers2

7

What you are looking for is handled by the TEdit.TextHint property. Note that it only works on XP and later with Visual Themes/Styles enabled for the app.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
2

In case anyone got here like me through a web search, in cross-platform versions of Delphi using FMX, the placeholder display is handled by TEdit.TextPrompt.

bLight
  • 803
  • 7
  • 23