ListBox如何更改选中行的背景色

Shawn 2011-08-27 01:02:13
<ListBox Grid.Row="2" Grid.Column="0"
x:Name="listBooks"
Margin="0,20,0,0" >
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Height" Value="100"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Border BorderBrush="Silver"
BorderThickness="1">
<Image x:Name="Thumbnail"
Stretch="Fill"
Source="{Binding Image}"/>
</Border>
<TextBlock Grid.Row="0" Grid.Column="0"
Text="test" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
...全文
787 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chen_ya_ping 2011-08-28
  • 打赏
  • 举报
回复
Blend真是个好东东。
lcp147572931 2011-08-27
  • 打赏
  • 举报
回复
1楼正解 用blend修改Listbox模版样式
namhyuk 2011-08-27
  • 打赏
  • 举报
回复
fillColor:对应鼠标经过时的;
fillColor2:对应选中行。
namhyuk 2011-08-27
  • 打赏
  • 举报
回复




8,756

社区成员

发帖
与我相关
我的任务
社区描述
WPF/Silverlight相关讨论
社区管理员
  • WPF/Silverlight社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧