gpt4 book ai didi

c# - 在wpf C#中构造超链接

转载 作者:行者123 更新时间:2023-11-30 20:12:27 25 4
gpt4 key购买 nike

如何在 C# 编码中的超链接中插入 TextBlock 控件。如同 <TextBlock> <Hyperlink>a</Hyperlink></textblock在 C# 中。我无法在超链接中找到内容属性。提前致谢。

最佳答案

尝试使用Inlines将超链接添加到 TextBlock 并将文本添加到超链接

TextBlock textBlock = new TextBlock();
Hyperlink link = new Hyperlink();
link.Inlines.Add("Click me");
textBlock.Inlines.Add(link);

关于c# - 在wpf C#中构造超链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2644382/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com