How can i allow the user to choose the color of the item highlight, when the combobox drop is down and the user has the cursor over the element?(i'm using System.Windows.Controls.ComboBox)
Asked
Active
Viewed 870 times
2 Answers
0
you have to handle the DrawItem of the combobox and create the Graphics accordingly what you want to display.
Following two links will give you Idea how to achieve this Msdn Link

Community
- 1
- 1

kishore V M
- 818
- 6
- 13
-
OP says (i'm using System.Windows.Controls.ComboBox) – Sriram Sakthivel Sep 09 '14 at 12:57
-
These answers are using windows.system.forms, control has different properties, i don't know how to do the same. – user3284435 Sep 09 '14 at 13:15
0
The combobox contains, in his resources, the color of the selection. To change it is necessary to remove the resource and insert a new one with the changes you want to make. On the example below '_highlightItem.SelectedBrush' is the new color to be set on the resource.
if (_highlightItem.SelectedBrush != null)
{
if (m_oComboBox.Resources.Contains(SystemColors.HighlightBrushKey))
m_oComboBox.Resources.Remove(SystemColors.HighlightBrushKey);
m_oComboBox.Resources.Add(SystemColors.HighlightBrushKey, _highlightItem.SelectedBrush);
}

user3284435
- 1
- 2