新手求教,关于listbox选中项左右上下间隔问题,和选中默认蓝底问题

若风09 若风09 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位大神,我想实现的功能很简单:现有一个listbox,然后,部分前端代码如下
 
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid Tag="{Binding CardCode}" Background="{Binding DisPlayColor,UpdateSourceTrigger=PropertyChanged}" Margin="5,5,5,5" Name="gridCardList" Width="80" Height="60">
<Label Content="{Binding MnemonicCode}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
<Label Content="{Binding DisplayStatus}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" VerticalAlignment="Top" HorizontalAlignment="Stretch" />
</Grid>
</DataTemplate>

我通过加载,希望获取一个列表出来,然后选中每一项,但是运行出来不是我想要的,发现选中时,左边的线框明显要比右边线框粗,我希望两边一样的,可以看效果图。另外,我想问一下,怎么样才能取消掉选中项的背景色是蓝色,好像listbox默认选中项的边框就是蓝色,效果图上的颜色是因为我手动设置了样式的!先多谢各位了
...全文
评论 2
收藏 已收藏
分享
返回顶部
若风09
WPF/Silverlight 8,757 成员 12,031 内容