gpt4 book ai didi

c# - 从 WPF ListBox 中删除所有左填充

转载 作者:IT王子 更新时间:2023-10-29 04:18:35 25 4
gpt4 key购买 nike

WPF ListBox 控件中的每个项目似乎都有一点左填充。如何重新设计样式以移除所有填充?

Default Comparison

最佳答案

您还可以为特定的 ListBox 设置 ListBoxItem 的样式,如下所示:

<ListBox>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>

关于c# - 从 WPF ListBox 中删除所有左填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/435925/

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