WPF altering property on just PART_EditableTextBox of a combBox

Viewed 2748

I would like to make a change to the PART_EditableTextBox of the default wpf combobox (change the background for example).

I tried adding a style like this:

<Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource {x:Type ComboBox}}">
  <Setter Property="Control.Template">
    <Setter.Value>
      <ControlTemplate TargetType="ComboBox">
        <TextBox x:Name="PART_EditableTextBox" Background="AntiqueWhite"/>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

But that causes the rest of the default template to be ignored.

Is there a way I can just override a specific property of the PART_EditableTextBox or do I have to copy over the entire control template and make my change in there?

2 Answers
Related