<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx</link><description>This post covers some tips and tricks that people frequently ask concerning specifying the appearance of a ListBox. Here’s some things that someone, somewhere, might find useful: 
 
 Specifying the Selection Color 
 
 If you’ve ever tried the following</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9951582</link><pubDate>Thu, 21 Jan 2010 19:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9951582</guid><dc:creator>Carole Snyder - MSFT</dc:creator><description>&lt;p&gt;Hi Donny,&lt;/p&gt;
&lt;p&gt;Thanks for your feedback. &amp;nbsp;You're right, this is a tricky problem. &amp;nbsp;Were you expecting to find this information on MSDN, or is there another way you would have liked to have found this information? &amp;nbsp; &amp;nbsp;We do sometimes publish tips and tricks on our blog that aren't in our official documentation, because blogs are sometimes so much easier to produce. &amp;nbsp;We'd love to hear more about what you meant. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Carole&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9951582" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9951500</link><pubDate>Thu, 21 Jan 2010 16:28:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9951500</guid><dc:creator>donny</dc:creator><description>&lt;p&gt;This is a really great tip. But if I don't work for Microsoft how exactly was I suppose to know how to do this?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9951500" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9850385</link><pubDate>Tue, 28 Jul 2009 01:52:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9850385</guid><dc:creator>smercer</dc:creator><description>&lt;p&gt;The color keys are useful, but there's still one more color involved in selection -- the color of the dotted line around the perimeter of the selected item. &lt;/p&gt;
&lt;p&gt;a) What is the name of the key for that color?&lt;/p&gt;
&lt;p&gt;b) How do you find a list of all the keys used by a given control?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9850385" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9569823</link><pubDate>Mon, 27 Apr 2009 00:57:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9569823</guid><dc:creator>Jan Kučera</dc:creator><description>&lt;p&gt;Hi Carole,&lt;/p&gt;
&lt;p&gt;Yes you understand the question well. So it's basically a choice whether to lock brush type or listbox template from being updated with future framework updates. I guess that fixing the brush type to solid is a bit better choice. Anyway, thank you for your response! At least I know I don't miss anything.&lt;/p&gt;
&lt;p&gt;Jan&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9569823" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9567103</link><pubDate>Fri, 24 Apr 2009 21:01:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9567103</guid><dc:creator>Carole Snyder - MSFT</dc:creator><description>&lt;p&gt;Hi Jan,&lt;/p&gt;
&lt;p&gt;Sorry for the delay in getting back to you. &amp;nbsp;If I undersstand your question, in some place the ControlBrush is used, but you want the HighlightBrush to be used instead. &amp;nbsp;Basically, you want a copy of the HighlightBrush and give it the key ControlBrushKey. &amp;nbsp;There isn't a way to do this. &amp;nbsp;In this case, you have to copy the control template and change the references from the ControlBrush to the HighlightBrush. &amp;nbsp;Sorry I don't have better news for you.&lt;/p&gt;
&lt;p&gt;Carole&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9567103" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9557209</link><pubDate>Mon, 20 Apr 2009 23:12:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9557209</guid><dc:creator>Jan Kučera</dc:creator><description>&lt;p&gt;Hello again!&lt;/p&gt;
&lt;p&gt;Could this trick be used to replace one brush with another? I'm trying to implement HideSelection=False on a ListBox. The easiest I could come up with is:&lt;/p&gt;
&lt;p&gt;&amp;lt;Style.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;SolidColorBrush x:Key=&amp;quot;{x:Static SystemColors.ControlBrushKey}&amp;quot; Color=&amp;quot;{x:Static SystemColors.HighlightColor}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Style.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt;But this creates solid brush even if HighlightBrush wasn't solid. Is there any way how to do this while preserving the whole brush type and its properties?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;Jan&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9557209" width="1" height="1"&gt;</description></item><item><title>WPF ListBox и DataTemplates - В чем их сила и как избавится от стандартного синего маркера выделения?</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#9253780</link><pubDate>Fri, 26 Dec 2008 22:04:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9253780</guid><dc:creator>Microsoft for Developers - Roman Zdebskiy</dc:creator><description>&lt;p&gt;В очередной раз получил данный вопрос и решил поделиться ответом со всеми. &amp;amp;#160; Как я думаю, многие&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9253780" width="1" height="1"&gt;</description></item><item><title>Setting the Selection Color for a list box item in WPF</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#6685952</link><pubDate>Fri, 07 Dec 2007 02:03:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6685952</guid><dc:creator>Nir's Software Company</dc:creator><description>&lt;p&gt;Setting the Selection Color for a list box item in WPF&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6685952" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#4854054</link><pubDate>Mon, 10 Sep 2007 19:00:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4854054</guid><dc:creator>wcsdkteam</dc:creator><description>&lt;p&gt;Hi Jan,&lt;/p&gt;
&lt;p&gt;Good questions. &amp;nbsp;Regarding the foreground, the following keys are used:&lt;/p&gt;
&lt;p&gt;Key when the ListBox has focus: SystemColors.HighlightTextBrushKey&lt;/p&gt;
&lt;p&gt;Key when the ListBox does not have focus: SystemColors.ControlTextBrushKey&lt;/p&gt;
&lt;p&gt;But the ListBoxItem control template changes the Foreground property of the ListBoxItem, so you can also just use a Trigger to change the color of the Foreground.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Style TargetType=&amp;quot;ListBoxItem&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Style.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SolidColorBrush x:Key=&amp;quot;{x:Static SystemColors.HighlightBrushKey}&amp;quot; Color=&amp;quot;LightGreen&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;SolidColorBrush x:Key=&amp;quot;{x:Static SystemColors.ControlBrushKey}&amp;quot; Color=&amp;quot;LightBlue&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Style.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Style.Triggers&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Trigger Property=&amp;quot;IsSelected&amp;quot; Value=&amp;quot;True&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter Property=&amp;quot;Foreground&amp;quot; Value=&amp;quot;Red&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Trigger&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Style.Triggers&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Style&amp;gt;&lt;/p&gt;
&lt;p&gt;To turn of highlighting, I believe using the Transparent brush is easiest. &amp;nbsp;Another option is to redefine the control tenplate of the ListBoxItem and remove the triggers for IsSelected. &amp;nbsp;Here’s the ControlTemplate defined in WPF. &amp;nbsp;I’ve marked which triggers should be removed to disable selection highlighting.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ControlTemplate TargetType=&amp;quot;{x:Type ListBoxItem}&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Border Name=&amp;quot;Bd&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Background=&amp;quot;{TemplateBinding Background}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BorderBrush=&amp;quot;{TemplateBinding BorderBrush}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BorderThickness=&amp;quot;{TemplateBinding BorderThickness}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Padding=&amp;quot;{TemplateBinding Padding}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SnapsToDevicePixels=&amp;quot;true&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ContentPresenter HorizontalAlignment=&amp;quot;{TemplateBinding HorizontalContentAlignment}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VerticalAlignment=&amp;quot;{TemplateBinding VerticalContentAlignment}&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SnapsToDevicePixels=&amp;quot;{TemplateBinding SnapsToDevicePixels}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Border&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ControlTemplate.Triggers&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!--***REMOVE THIS TRIGGER**--&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Trigger Property=&amp;quot;IsSelected&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value=&amp;quot;true&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter TargetName=&amp;quot;Bd&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Property=&amp;quot;Background&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value=&amp;quot;{DynamicResource {x:Static SystemColors.HighlightBrushKey}}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter Property=&amp;quot;Foreground&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value=&amp;quot;{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Trigger&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!--***REMOVE THIS TRIGGER**--&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;MultiTrigger&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;MultiTrigger.Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Condition Property=&amp;quot;IsSelected&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Condition Property=&amp;quot;Selector.IsSelectionActive&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value=&amp;quot;false&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/MultiTrigger.Conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter TargetName=&amp;quot;Bd&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Property=&amp;quot;Background&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value=&amp;quot;{DynamicResource {x:Static SystemColors.ControlBrushKey}}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter Property=&amp;quot;Foreground&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value=&amp;quot;{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/MultiTrigger&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Trigger Property=&amp;quot;IsEnabled&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Value=&amp;quot;false&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;Setter Property=&amp;quot;Foreground&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value=&amp;quot;{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/Trigger&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ControlTemplate.Triggers&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/ControlTemplate&amp;gt;&lt;/p&gt;
&lt;p&gt;Note that you could also redefine the LlistBoxItem ControlTemplate to change the color of the background of the ListBoxItem by changing the Values in the setters above...but the point of the post was to show how change the color without having to redefine the ControlTemplate.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4854054" width="1" height="1"&gt;</description></item><item><title>re: Specifying the Selection Color, Content Alignment, and Background Color for items in a ListBox</title><link>http://blogs.msdn.com/b/wpfsdk/archive/2007/08/31/specifying-the-selection-color-content-alignment-and-background-color-for-items-in-a-listbox.aspx#4831227</link><pubDate>Sat, 08 Sep 2007 18:45:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4831227</guid><dc:creator>Jan Kučera</dc:creator><description>&lt;p&gt;Hello, useful tips, indeed.&lt;/p&gt;
&lt;p&gt;However, when you set the HighlightBrushKey to the Transparent or some light color, it is likely you also wan't to change the text color. What's the key here? ;-)&lt;/p&gt;
&lt;p&gt;Second, if I just want to turn off such highlighting, is there any better way then setting HighlightBrushKey and ControlBrushKey to Transparent?&lt;/p&gt;
&lt;p&gt;Thanks, Jan.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4831227" width="1" height="1"&gt;</description></item></channel></rss>