如何使用Delphi在TRichEdit中添加超链接

时间:2020-03-06 14:21:52  来源:igfitidea点击:

如何在TRichEdit中添加HyperLink(使用Delphi)。

我需要有类似的东西:

"这是我的文字,请单击此处执行操作。"

解决方案

根据delphi.about.com上的这篇文章

Unfortunately, Delphi's implementation of the RichEdit control leaves out a lot of the functionality found in more recent versions of this control (from Microsoft).

我们可以按照此处的讨论添加自己的功能。

注意:Delphi 2009刚刚发布,因此TRichEdit控件可能已更新为支持模式功能。

如果我们真的想要超链接等,可以查看TRichView。链接文本中很好地展示了其功能。

Infopower中的richedit支持超链接。

我不知道About.com文章中是否提到了它,但我认为值得一提的是,只有将TRichEdit本身直接放置在表单上(而不是在面板中),TRichEdit中的超链接才有效。

http://www.scalabium.com/faq/dct0146.htm