gpt4 book ai didi

wpf - 在 WPF 中使用 TextBlock 进行字母间距(跟踪)?

转载 作者:行者123 更新时间:2023-12-04 20:08:02 25 4
gpt4 key购买 nike

在 WPF 中使用 TextBlock 进行字母间距(跟踪)的最佳方法是什么?

我认为 TextBlock.Typography 会解决这个问题,但事实并非如此。什么是最好的方法?

最佳答案

看来这个问题不是很容易解决的。你可以谷歌并找到这样的东西http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/789c3e1b-e3ae-476f-b37f-d93ef6d0cb7b/ (使用字形的方法)。但是考虑到 String 是可枚举集合这一事实,有时您可以使用这样的标记来解决您的问题:

<Grid>
<ItemsControl>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Rows="1"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemsSource>
<System:String>
Hello World
</System:String>
</ItemsControl.ItemsSource>
</ItemsControl>
</Grid>

调整此标记(面板、模板)您可以获得任何所需的字符串布局。当然,您可以将此标记分离到一个特殊的 UserControl。就像特定情况下的变体一样。

关于wpf - 在 WPF 中使用 TextBlock 进行字母间距(跟踪)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3894543/

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