❔ ComboBox Color

I dont know how to change the color of the combobox in WPF, any help?
18 Replies
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
tried using property manager but cant figure it out
ACiDCA7
ACiDCA72y ago
in the xaml without more information what you actually want to change i cant be more specific
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
<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
ACiDCA7
ACiDCA72y ago
what of the copmbbox.. there are so many elemnts inside where you can change the color
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
right now its set as white, and i dont know how to change the color
ACiDCA7
ACiDCA72y ago
so background? did you try set background to any other color?
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
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
ACiDCA7
ACiDCA72y ago
you might have to create a new controltemplate for that
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
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?
ACiDCA7
ACiDCA72y ago
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
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
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
ACiDCA7
ACiDCA72y ago
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
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
think there are youtube videos on it?
ACiDCA7
ACiDCA72y ago
ofc
F͓̽u͓̽c͓̽k͓̽i͓̽n͓̽R͓̽7͓̽a͓̽n͓̽
Still was not able to figure it out
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server