none
systemcolors RRS feed

  • Question

  • I wanted to change the color of the selection highlight in my controls so
    they match the color scheme of my application. So at the beginning of my
    resourcedictionary I have:

    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
    Color="#FF004637" />


    In listboxes and comboboxes, etc this works great. The items are all
    highlighted in the dark green color I specified instead of the light grey
    color that is defined in my systemcolors. Best yet I'm not redefining my
    systemcolors by doing the above so no other application I run will be
    effected by the xaml.

    However, I noticed that although comboxes, etc highlight their selections
    with the correct color, textboxes do not. When I click in a textbox the entry
    is highlighted with the same dull light grey which is defined in my
    computer's systemcolors.

    Can anyone explain why only the the textbox remains untouched by my xaml?
    Does it use a different systemcolor? If so, does anyone know which one?
    Friday, February 22, 2008 7:22 PM

All replies

  • By: chutch15

    What kind of control did you use?  System or Simple?  System gets colors 
    according to your Windows theme.
    
    "sryan" wrote:
    
    > I wanted to change the color of the selection highlight in my controls so 
    > they match the color scheme of my application. So at the beginning of my 
    > resourcedictionary I have:
    > 
    > <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
    > 					 Color="#FF004637" />
    > 
    > In listboxes and comboboxes, etc this works great. The items are all 
    > highlighted in the dark green color I specified instead of the light grey 
    > color that is defined in my systemcolors. Best yet I'm not redefining my 
    > systemcolors by doing the above so no other application I run will be 
    > effected by the xaml.
    > 
    > However, I noticed that although comboxes, etc highlight their selections 
    > with the correct color, textboxes do not. When I click in a textbox the entry 
    > is highlighted with the same dull light grey which is defined in my 
    > computer's systemcolors.
    > 
    > Can anyone explain why only the the textbox remains untouched by my xaml? 
    > Does it use a different systemcolor? If so, does anyone know which one?
    > 
    > 
    Monday, February 25, 2008 10:29 PM
  • By: sryan

    As stated in my previous post the textbox is the control I'm having trouble 
    with.
    
    As for your statement regarding "System gets colors according to your 
    Windows theme." That's usually true. However, as I stated in my previous 
    post, when I use the xaml line "<SolidColorBrush x:Key="{x:Static 
    SystemColors.HighlightBrushKey}"
    Color="#FF004637" />" in my resourcedictionary, I'm overwriting that 
    systemcolor for my application. And it works for all controls except in the 
    case of the textbox. My question is why?
    
    
    "chutch15" wrote:
    
    > What kind of control did you use?  System or Simple?  System gets colors 
    > according to your Windows theme.
    > 
    > "sryan" wrote:
    > 
    > > I wanted to change the color of the selection highlight in my controls so 
    > > they match the color scheme of my application. So at the beginning of my 
    > > resourcedictionary I have:
    > > 
    > > <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
    > > 					 Color="#FF004637" />
    > > 
    > > In listboxes and comboboxes, etc this works great. The items are all 
    > > highlighted in the dark green color I specified instead of the light grey 
    > > color that is defined in my systemcolors. Best yet I'm not redefining my 
    > > systemcolors by doing the above so no other application I run will be 
    > > effected by the xaml.
    > > 
    > > However, I noticed that although comboxes, etc highlight their selections 
    > > with the correct color, textboxes do not. When I click in a textbox the entry 
    > > is highlighted with the same dull light grey which is defined in my 
    > > computer's systemcolors.
    > > 
    > > Can anyone explain why only the the textbox remains untouched by my xaml? 
    > > Does it use a different systemcolor? If so, does anyone know which one?
    > > 
    > > 
    Monday, February 25, 2008 10:30 PM