RichTextBox超链接奇怪的行为...... [英] RichTextBox hyperlinks strange behavior...

查看:85
本文介绍了RichTextBox超链接奇怪的行为......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Here's the issue:

Example: If I open an rtf file in Notepad and insert the following string somewhere,

{\field{\*\fldinst { HYPERLINK "TEST LINK" }}{\fldrslt {TEST}}}

save the file (as .rtf) and then load it into a RichTextBox, the link shows up as a clickable, underlined link. Great. This is what I want, a hyperlink with a non-standard link type (i.e. not one of the "standard" link types like file:/// or http:/// etc., just a plain old text link.)

HOWEVER, trying to insert the link directly into the richtextbox at runtime, like this:
(assume the selection is not nothing)

SelectedRtf="\rtf1\ansi {\field{\*\fldinst { HYPERLINK ""TEST LINK"" }}{\fldrslt {TEST}}}"

Fails to modify the rtf. Why is this?





推荐答案

你可以澄清一件事:

你想要这样的东西:



www.testurl .com



而不是



http://www.testurl.com作为链接富文本框,是吗?
Can you please clarify one thing :
Do you want something like this:

www.testurl.com

instead of

http://www.testurl.com as a link in a rich text box , is that right?


这篇关于RichTextBox超链接奇怪的行为......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆