• <i id='mSKgg'><tr id='mSKgg'><dt id='mSKgg'><q id='mSKgg'><span id='mSKgg'><b id='mSKgg'><form id='mSKgg'><ins id='mSKgg'></ins><ul id='mSKgg'></ul><sub id='mSKgg'></sub></form><legend id='mSKgg'></legend><bdo id='mSKgg'><pre id='mSKgg'><center id='mSKgg'></center></pre></bdo></b><th id='mSKgg'></th></span></q></dt></tr></i><div id='mSKgg'><tfoot id='mSKgg'></tfoot><dl id='mSKgg'><fieldset id='mSKgg'></fieldset></dl></div>

    <small id='mSKgg'></small><noframes id='mSKgg'>

      <legend id='mSKgg'><style id='mSKgg'><dir id='mSKgg'><q id='mSKgg'></q></dir></style></legend>
      • <bdo id='mSKgg'></bdo><ul id='mSKgg'></ul>

      1. <tfoot id='mSKgg'></tfoot>
      2. 将选定和未聚焦的列表框样式更改为不灰显

        时间:2023-10-07
        <tfoot id='FAYmB'></tfoot>

        • <small id='FAYmB'></small><noframes id='FAYmB'>

            <legend id='FAYmB'><style id='FAYmB'><dir id='FAYmB'><q id='FAYmB'></q></dir></style></legend>
            <i id='FAYmB'><tr id='FAYmB'><dt id='FAYmB'><q id='FAYmB'><span id='FAYmB'><b id='FAYmB'><form id='FAYmB'><ins id='FAYmB'></ins><ul id='FAYmB'></ul><sub id='FAYmB'></sub></form><legend id='FAYmB'></legend><bdo id='FAYmB'><pre id='FAYmB'><center id='FAYmB'></center></pre></bdo></b><th id='FAYmB'></th></span></q></dt></tr></i><div id='FAYmB'><tfoot id='FAYmB'></tfoot><dl id='FAYmB'><fieldset id='FAYmB'></fieldset></dl></div>
                • <bdo id='FAYmB'></bdo><ul id='FAYmB'></ul>
                    <tbody id='FAYmB'></tbody>
                  本文介绍了将选定和未聚焦的列表框样式更改为不灰显的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个非常简单的 WPF 列表框,其中 SelectionMode 设置为 Multiple.

                  I have a really simple WPF ListBox with SelectionMode set to Multiple.

                  <ListBox SelectionMode="Multiple" />
                  

                  当 ListBox 失去焦点时,很难判断选择了什么,因为选择的颜色会从蓝色变为浅灰色.更改此行为以使其保持蓝色的最简单方法是什么?

                  When the ListBox loses focus it's really hard to tell what's been selected because the selection colour changes from blue to a light grey colour. What's the easiest way of changing this behaviour so that it stays blue?

                  我知道这可能与 ListItem 的样式有关,但我找不到.

                  I know it's probably something to do with the ListItem's style, but I can't find where.

                  干杯.

                  类似:WPF ListView 非活动选择颜色

                  推荐答案

                  我在合并的 ResourceDictionary 中使用以下内容做了类似的事情,它可能会对您有所帮助:

                  I have done something like this using the following in a merged ResourceDictionary, it may help you:

                  <Style TargetType="ListBoxItem">
                      <Style.Resources>
                          <!--SelectedItem with focus-->
                          <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue" Opacity=".4"/>
                          <!--SelectedItem without focus-->
                          <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey }" Color="LightBlue" Opacity=".4"/>
                      </Style.Resources>
                  </Style>
                  

                  这篇关于将选定和未聚焦的列表框样式更改为不灰显的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:ItemContainerGenerator.ContainerFromItem 如何处理分组列表? 下一篇:如果内容字符串宽度大于 ListBox 宽度,Winforms DotNet ListBox 项目以自动换行?

                  相关文章

                    <bdo id='2NCw2'></bdo><ul id='2NCw2'></ul>
                  <i id='2NCw2'><tr id='2NCw2'><dt id='2NCw2'><q id='2NCw2'><span id='2NCw2'><b id='2NCw2'><form id='2NCw2'><ins id='2NCw2'></ins><ul id='2NCw2'></ul><sub id='2NCw2'></sub></form><legend id='2NCw2'></legend><bdo id='2NCw2'><pre id='2NCw2'><center id='2NCw2'></center></pre></bdo></b><th id='2NCw2'></th></span></q></dt></tr></i><div id='2NCw2'><tfoot id='2NCw2'></tfoot><dl id='2NCw2'><fieldset id='2NCw2'></fieldset></dl></div>

                  <small id='2NCw2'></small><noframes id='2NCw2'>

                • <legend id='2NCw2'><style id='2NCw2'><dir id='2NCw2'><q id='2NCw2'></q></dir></style></legend>

                    <tfoot id='2NCw2'></tfoot>