KrystianB
KrystianB

Reputation: 502

C# WPF BorderBrush won't set color

I have a borderbrush that won't actually change the color of the border. Here is my XAML for the combobox. Any ideas?

<ComboBox IsEditable="True" IsReadOnly="False"
                      Text="{Binding Model.Number}" ItemsSource="{Binding Item}"
                      SelectedItem="{Binding Model.Number}"    
                      VerticalAlignment="Top"
                      BorderBrush="Red"
                      BorderThickness="2">
</ComboBox>

Upvotes: 1

Views: 2907

Answers (1)

Mat
Mat

Reputation: 2072

If you just want a red border around your ComboBox (or any other control), you can use a Border.

<Border    BorderBrush="Red"
            BorderThickness="2">
    <ComboBox IsEditable="True"
                IsReadOnly="False"
                Text="{Binding Model.Number}"
                ItemsSource="{Binding Item}"
                SelectedItem="{Binding Model.Number}"
                VerticalAlignment="Top"></ComboBox>
</Border>

Upvotes: 2

Related Questions