简体   繁体   English

Metro样式RichTextBox控件启用URL检测?

[英]Metro Style RichTextBox Control Enable URL Detection?

The Problem 问题

In the .NET Framework, it would just be a matter of setting a property true and hooking to the link clicked event. 在.NET Framework中,只需将属性设置为true并挂接到链接单击事件即可。 But how would I do this in WinRT using the limited .NET framework. 但是我将如何使用有限的.NET框架在WinRT中执行此操作。

Why Is This Necessary? 为什么有此必要?

Well I want to create a text based web browser (like Lynx but with a GUI), that is designed with people who don't want to use a fancy web browser or just need accessibility. 好吧,我想创建一个基于文本的Web浏览器(例如Lynx,但带有GUI),该浏览器是为那些不想使用高级Web浏览器或只需要可访问性的人设计的。 Some of the features would be to display the URLs for instance 'http://stackoverflow.com/' to a URL in which I hookup the link clicked event and then redirect within the program and display the text. 其中一些功能是将实例“ http://stackoverflow.com/”的URL显示为一个URL,在该URL中,我将链接单击的事件连接起来,然后在程序中重定向并显示文本。

Conclusion 结论

Requesting the HTML and converting it to text, was simple, and I already have it done and working fine. 请求HTML并将其转换为文本很简单,我已经完成了工作并且工作正常。 So the only thing I need from the Stack Overflow community. 所以我唯一需要Stack Overflow社区提供的东西。 Is whether the RichTextBox support hyper-links? RichTextBox是否支持超链接? and how can it be done? 怎么做? No code examples necessary, but pointers will just do. 不需要任何代码示例,但是指针可以。 I have already done research, but Metro Style applications are just fresh out of the oven; 我已经做过研究,但是Metro Style应用程序刚出炉。 not a lot of articles out there. 那里没有很多文章。

The Windows-8 App style way of doing this is to put a button inside an InlineUIContainer inside a textblock. Windows-8应用程序样式的实现方法是在文本块内的InlineUIContainer放置一个按钮。

See here for some related discussion. 请参阅此处进行一些相关讨论。

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

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