Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi: Using TextHint in a multiline text component such as TMemo or TRichEdit

Tags:

delphi

TextHint is the TEdit property which let's you display a greyed text hint inside the textbox, when the textbox is empty.

I want to place the same kind of hint in a TMemo, or TRichEdit, since the TEdit component does not allow multiline.

How can I use a TextHint inside a multiline text control in Delphi? The TextHint property actually exists in TMemo and TrichEdit components, but it seems to have no effect.

Thank you in advance.

like image 317
Flavio Avatar asked Mar 09 '23 06:03

Flavio


1 Answers

The TextHint property is implemented using the EM_SETCUEBANNER message. Windows itself simply does not support that message on those UI controls:

You cannot set a cue banner on a multiline edit control or on a rich edit control.

like image 82
Uwe Raabe Avatar answered May 10 '23 16:05

Uwe Raabe