简体   繁体   English

Delphi:在多线文本组件(如TMemo或TRichEdit)中使用TextHint

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

TextHint is the TEdit property which let's you display a greyed text hint inside the textbox, when the textbox is empty. TextHint是TEdit属性,当文本框为空时,它允许您在文本框中显示灰色文本提示。

I want to place the same kind of hint in a TMemo, or TRichEdit, since the TEdit component does not allow multiline. 我想在TMemo或TRichEdit中放置相同类型的提示,因为TEdit组件不允许多行。

How can I use a TextHint inside a multiline text control in Delphi? 如何在Delphi中的多行文本控件中使用TextHint? The TextHint property actually exists in TMemo and TrichEdit components, but it seems to have no effect. TextHint属性实际存在于TMemo和TrichEdit组件中,但它似乎没有任何效果。

Thank you in advance. 先感谢您。

The TextHint property is implemented using the EM_SETCUEBANNER message . TextHint属性使用EM_SETCUEBANNER消息实现 Windows itself simply does not support that message on those UI controls: Windows本身根本不支持这些UI控件上的消息:

You cannot set a cue banner on a multiline edit control or on a rich edit control. 您无法在多行编辑控件或富编辑控件上设置提示横幅。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM