1
如何改變了我的組合框的背景我已經能夠用新的ItemTemplate 做的項目,但不是組合框本身作爲畫筆屬性不爲 i want to change this如何更改組合框的背景
工作組合框:
<ComboBox x:Name="Bil_box" HorizontalAlignment="Center" Margin="57,33,968,799" VerticalAlignment="Center" Width="151" Height="40" Foreground="#FF00FB0B" Background="#FF303030" ItemTemplate="{StaticResource cmbTemplate}">
<ComboBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#FF303030" />
</ComboBox.Resources>
</ComboBox>
模板:
<DataTemplate x:Key="cmbTemplate">
<WrapPanel Margin="0 5 0 5" Height="30">
<Image Width="20" Height="20" Stretch="Fill" Source="{Binding Billed}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,15,0"/>
<Label Content="{Binding bilmærke}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Foreground="#FF00FB0B"/>
<Label Content="{Binding Krydsmål}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" Foreground="#FF00FB0B"/>
</WrapPanel>
</DataTemplate>`
THX奏效 –
有沒有其他的方式來做到這一點,因爲你只能做一個沒有PresentationFramework.Aero2,至少在win7上給我一些錯誤,因爲只有win8和above功能 –