tags:

views:

1024

answers:

1

hi, How can i make a combobox edges rounded..?.I have tried in blend,but no success till now..Any input will be highly helpfull

+1  A: 

You need to create a custom Style in XAML for your ComboBox in which the outer container is a border with rounded corners. In this particular example, it's a default style that will be blanket applied throughout your application. The content of the control and ContentPresenter must still be declared within the Border.

<Style TargetType="{x:Type ComboBox}">
  ...
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type ComboBox}">
        <Border CornerRadius="5">
          ...
        </Border>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
Jeff Wain
Correct, but 'custom template' not 'custom style'.
Oleg Mihailik
So i have to completely override the combobox template and add my own template right..?
That would be correct. And yes, Oleg is right on templating, you could just override the ControlTemplate. I prefer to add additional functionality via the Style, hence my declaration above.
Jeff Wain