I am doing WPF and have a comboBox that has a list of available ports on the computer. I want to change the color of these elements.
My comboBox:
<ComboBox HorizontalAlignment="Left" Margin="445,0,0,0" VerticalAlignment="Top" Width="120" Loaded="ComboBoxLoaded" SelectionChanged="ComboBoxSelectionChanged" Grid.Column="1" Background="#849096" Foreground="White"/>
And this is the way to download it:
private void ComboBoxLoaded(object sender, RoutedEventArgs e)
{
string [] portsList = PrintPorts();
var comboBox = sender as ComboBox;
comboBox.ItemsSource = portsList;
comboBox.SelectedIndex = 0;
}
I tried a lot of things, but nothing works. Does anyone know how to do this? Thank!!
Irapp source
share