index > Windows Presentation Foundation ("Avalon") > how to change ComboBox selection color

how to change ComboBox selection color

I have a ComboBox with some ComboBoxItems. The selection color is gray. I want to change it. How can I do this? Can I have a different color for the selection on the combobox and on the comboboxitem? (In fact, I want to have a selection color on my comboboxitem selected when my combo is opened and no selection color on my combobox when my combo is closed). I want to have a different Selection Color on the selected ComboBoxItem (I choose first item, I move my mouse on the second item, the selection color is color1. I move the mouse on first item, the selection color is color2)
MMEZIL
So you want to have alternate selection color for each ComboBoxItem, uh?

then you can use the ItemTemplateSelector to do the trick.

Sheva



WPF C# & Other .Net Related Goodness http://shevaspace.spaces.live.com/
Zhou Yong
For all these customizations you should change the controltemplate of the combobox
lee d
reply 3

You can use google to search for other answers

 

More Articles

• Relative Image Path
• Strings, Integers, and Colors in Resources?
• AJAX style XAML generation on the server?
• Tricky: items with ARRAYs as properties: how can they be sorted ...
• Will TreeView.ChangeSelection() be virtual in the future? I've do...
• Disable page input during asynchronous process
• SolidBrush and Resource Dictionaries
• How to use hardware rendering / video flicker
• Custom extentions
• How can I use an animation on BitmapEffect GlowSize in a style
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• How can I have a movable popup?
• OnMediaEnded and weird MediaElement.Pla
• Textbox default contextmenu Style
• Looking for feedback for WPF Annotations
• Can I Access Button with AccessText?
• OuterGlowBitmapEffect : Softness
• How To Get Element within a Listview Cel
• Not able to get "A Visual" fro
• The Name attribute value 'label1' cannot
• InlineUIContainers not firing any events
• Smooth 8, using beziers
• Set Focus / Selection to child item
• What's the distinction between "c:&
• date picker not available, someone alrea
• How can I use ResourceDictionary for str

Hot Articles

• MarkupExtension to Connect WPF to CAB Se
• ITypedList not supported in data binding?
• Relative Image Path
• unable to focus to a control
• WindowsFormsHost and AllowsTransparency=
• Event registration fails with No error o
• Reg: Querystrings in wpf
• Validating with Regular Expressions
• Assigning the curved Border for the List
• Tearing in WPF
• binding a BitmapSource to a FormatConver
• Mouse Over
• How to Bind to an ADO.NET Data Source.
• Problem Animating Background in Style fo
• ComboBox and ContextMenu behavior on Tra

Recommend Articles

• getting the june ctp
• Data Binding: Can't set Content property
• Animating a ListBox Scrolling Text with
• Smart rendering of large amounts of geom
• extending canvas
• Providing alternate styles for a control
• Remove Security Bubble when displaying S
• Mousewheel Event in xaml
• OnChildAdded/removed event
• WPF apps slow for some reason
• How can I avoid Thread Safety in WPF?
• Can i pass URL query strings from one xa
• XAML RSS Reader problem
• Generic data types in XAML
• Post file in WinFX