2012-10-09 21 views
0

我希望這不是很愚蠢的問題。我有運行中的文本塊,我想添加超鏈接。如何修復錯誤「調試資源字符串不可用」

成才這樣

<Hyperlink NavigateUri="http://google.com"> 
<Run Text="http://google.com"/> 
</Hyperlink> 

我嘗試不同的方法,但每次我不得不添加超鏈接時,發生了錯誤。

Error 2 [TextElementCollection_TypeNotSupportedInHost] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem.

回答

1

TextBlock控制不支持Hyperlink子控件。 您應該使用RichTextBox代替,就像這樣:

<RichTextBox IsReadOnly="True"> 
    <Paragraph> 
     Displaying text with 
     <Hyperlink NavigateUri="http://www.google.com" TargetName="_blank">hyperlink</Hyperlink>. 
    </Paragraph> 
</RichTextBox> 
+0

這是如此簡單 –

相關問題