0

In my wpf Application i'm using a combobox. Setting a background Image for that combobox works in Windows 7 but not in Windows 10.

<ComboBox x:Name="MenubarTicketDet" Width="195" ItemsSource="{Binding}" SelectionChanged="_processticketcombobox" Foreground="Transparent" HorizontalAlignment="Center" BorderThickness="0" Height="30" Margin="46,4,16,331" BorderBrush="Transparent" IsHitTestVisible="True">
        <ComboBox.Resources>
            <sys:Double x:Key="{x:Static SystemParameters.VerticalScrollBarWidthKey}">0</sys:Double>
        </ComboBox.Resources>
        <!--</ComboBox>-->
        <ComboBox.Background>
            <ImageBrush ImageSource="Images/Newmenubarimages/list_box.png" Stretch="Uniform"/>
        </ComboBox.Background>
        <ComboBox.ItemContainerStyle>
            <Style TargetType="{x:Type ComboBoxItem}">
                <Setter Property="Padding" Value="5"/>
                <Setter Property="Width" Value="200"/>                   
                <Setter Property="FontFamily" Value="Courier New"/>
                <Setter Property="Foreground" Value="Black"/>
            </Style>
        </ComboBox.ItemContainerStyle>
     </ComboBox>
Nick Hooked
  • 440
  • 1
  • 5
  • 19
Surendar
  • 1
  • 4
  • 1
    You need to post the relevant code so we have some idea of what's happening, you need to post a [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) – Josh Aug 02 '16 at 16:05

1 Answers1

0

Looks like it may be an issue with a way the controls differ pre-Windows 8, and Windows 8 onwards, i.e. as seen here:

Combobox background not being applied in windows 8

There seems to be a thorough walkthrough on how to remedy this for W8/W8.1/W10 here:

https://blog.magnusmontin.net/2014/04/30/changing-the-background-colour-of-a-combobox-in-wpf-on-windows-8/

Community
  • 1
  • 1
Josh
  • 697
  • 7
  • 18