我剛剛閱讀了有關覆寫字形的資訊。我正在嘗試。這是組成 TreeViewItem.Header 的簡化 xaml 部分
<TreeViewItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Name="icon" FontFamily="Segoe MDL2 Assets"
Text="" Foreground="Blue" Background="cyan" />
<TextBlock Name="title"/>
</StackPanel>
</TreeViewItem.Header>
它會生成一個包含字形 ED0D 的標頭,如下所示:

但是,我想將 ED0C 覆寫
到字形 ED0D 上。
我可以通過哪些途徑來執行要在 TreeViewItem.Header 中使用的這種覆寫?
uj5u.com熱心網友回復:
將兩個 TextBlock 疊放在一起:
<StackPanel Orientation="Horizontal">
<Grid TextElement.FontFamily="Segoe MDL2 Assets">
<TextBlock Text="" Foreground="Cyan"/>
<TextBlock Text="" Foreground="Blue"/>
</Grid>
<TextBlock x:Name="title"/>
</StackPanel>
結果:

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/521334.html
標籤:C#。网wpf覆盖
上一篇:從另一個腳本參考主視窗中的物件?(VS、C#和WPF)
下一篇:如何使用以編程方式創建的文本框?
