❔ ComboBox Color
I dont know how to change the color of the combobox in WPF, any help?
18 Replies
tried using property manager but cant figure it out
in the xaml
without more information what you actually want to change i cant be more specific
<ComboBox x:Name="cmbSelectProcess"
Margin="0,12,0,0"
BorderThickness="0"
Cursor="Hand"
FontFamily="Nirmala UI"
Width="242"
/>
this is my code
i want to change the color of the combobox to a different color
what of the copmbbox.. there are so many elemnts inside where you can change the color
right now its set as white, and i dont know how to change the color
just that white
so background?
did you try set background to any other color?
yes
doesnt work
went into property manager of it tried changing, nothing has helped me so far
or even if i could make the drop down arrow a different color, and somehow make the combobox flat so its transparent
you might have to create a new controltemplate for that
comboBox1.Background = Brushes.Transparent;
comboBox1.BorderBrush = Brushes.Transparent;
// Change the color of the dropdown arrow
comboBox1.Foreground = Brushes.Purple;
// Change the color of the items in the dropdown list
comboBox1.IsEditable = false;
comboBox1.IsReadOnly = true;
comboBox1.ItemContainerStyle = new Style(typeof(ComboBoxItem))
{
Setters =
{
new Setter(ComboBoxItem.BackgroundProperty, Brushes.Purple),
new Setter(ComboBoxItem.ForegroundProperty, Brushes.White)
}
};
Something like this?
you could make it in codebehind, but this is discouraged.. xaml is the way to go for visual changes
rightclick the combobox->edit template->copy
then edit to your liking
thats a lot of code but ill look into it and try to figure it out
i have no clue what any of this stuff is
yeah if you create the template by yourself you can slim it down to just a couple of lines, but im currently not in the mental state to explain it well enough..xD
think there are youtube videos on it?
ofc
Still was not able to figure it out
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.