我的问题是我的复选框内容不显示下划线或&
象征。我读过有关RecognizeAccessKey
属性,但我无法让它工作。我的列表框如下所示:
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding Channels}">
<ListBox.ItemTemplate>
<DataTemplate>
<ContentPresenter RecognizesAccessKey="False">
<CheckBox Content="{Binding Item}"
IsChecked="{Binding IsChecked}"
Width="149"
MinWidth="149" />
</ContentPresenter>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
谁能告诉我如何解决这个问题,这样我的复选框的内容将显示下划线和&
符号?
非常感谢!
你可以使用TextBlock
as CheckBox.Content
,而不是直接绑定它,并绑定它的Text
财产
<CheckBox IsChecked="{Binding IsChecked}" Width="149" MinWidth="149">
<CheckBox.Content>
<TextBlock Text="{Binding Item}"/>
</CheckBox.Content>
</CheckBox>
默认情况下CheckBox
将包裹TextBlock
in AccessText
当它显示时Content
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)