【问题标题】:Changing the background color of a ListBoxItem更改 ListBoxItem 的背景颜色
【发布时间】:2012-11-09 02:22:11
【问题描述】:

我正在用 C# 编写一个 Windows 应用商店应用程序,如何更改 ListBoxItem 的背景颜色?

【问题讨论】:

  • ListBoxItem.Background = Brushes.White;虽然不工作

标签: c# windows-8 listboxitem windows-store-apps


【解决方案1】:

是的。您需要修改 ListBox 的 ItemTemplate。右键单击 ListBox,选择 Edit Additional Templates -> ItemTemplate。

【讨论】:

    【解决方案2】:

    这是一个很好的例子,你应该在不提供代码的情况下提出小问题之前进行更多研究,但我希望这有助于Check this example out

    【讨论】:

    • 事实上,我已经尝试过 Stack Overflow 提供的大多数类似问题,但它们都不起作用,包括您提供的链接
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-08
    相关资源
    最近更新 更多