-2
如何設置textwrapping =包裝到組合框項目的項目。我可以使用 ComboBox.ItemContainerStyle
還是必須編輯控制模板?將TextWrapping屬性設置爲ComboBox項目(wpf)
如何設置textwrapping =包裝到組合框項目的項目。我可以使用 ComboBox.ItemContainerStyle
還是必須編輯控制模板?將TextWrapping屬性設置爲ComboBox項目(wpf)
你可以定義一個ItemTemplate
:
<ComboBox ItemsSource="{Binding Items}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding YourDisplayProperty}" TextWrapping="Wrap" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>