如何检测超链接文本更改?
我拥有带有一些超链接的RichTextbox,这些超链接允许用户更改其文本,并且在更改文本时,我需要采取进一步的操作。超链接本身没有什么特别的,就像下面:
Hyperlink link = new Hyperlink();
Run run = new Run("haha");
link.Inlines.Add(run);
当用户在链接中输入时,我想检测到该用户操作并做出进一步的动作,类似:
link.textchanged += myHandler;
到目前为止,我尝试使用文本框作为超链接的内联,尽管它有效,但是当没有足够的空间时,有很多缺点,例如自动切换到下一行。
我还尝试使用TexTrange.Changed方法,但它不起作用。
谢谢!
I have this richtextbox with some hyperlinks, these hyperlinks allows users to change the text of it, and I need to make further actions when the text of it is changed. The hyperlink itself has nothing special, just like below:
Hyperlink link = new Hyperlink();
Run run = new Run("haha");
link.Inlines.Add(run);
When the users type within the link, I would like to detect that user action and make further moves, something like:
link.textchanged += myHandler;
So far, I tried to use textBox as the inline of the hyperlink, though it works, but there are so many downsides such as it automatically switch to the next line when there's no enough space.
I also tried to use textrange.changed method, but it did not work.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论