2

I am doing a touch application but the items of my ComboBox are very small. Is there any way to increase its size? I haven't found any way to do it. Thanks.

Jorge Perez
  • 35
  • 1
  • 7
  • 1
    See http://stackoverflow.com/questions/8746306/styling-wpf-combobox-items. – Daniel Corzo Nov 29 '16 at 16:12
  • @DanielCorzo: I cannot see where that link gives any reference to resizing the items - can you point out where please. – PaulF Nov 29 '16 at 16:23
  • 1
    Possible duplicate of [Change Item Height of ComboBox](http://stackoverflow.com/questions/35332518/change-item-height-of-combobox) – confusedandamused Nov 29 '16 at 16:27
  • 1
    @confusedandamused, it's for winforms.. /facepalm – Sinatr Nov 29 '16 at 16:31
  • You can style controls in WPF, basically by altering `ComboBox.ItemTemplate`. The problem with `ComboBox` is what you don't want to change template for selected item, see [this answer](http://stackoverflow.com/a/33421573/1997232) (in fact it looks complicated, but I can't find simpler where you just define own template selector and use it for ComboBox, poke me if you still have problems tomorrow). – Sinatr Nov 29 '16 at 16:34

1 Answers1

11

This will do it, just give it the height and/or width you want within these setters.

 <ComboBox Width="200"
           Height="50"
           ItemsSource="{Binding MyList}">
        <ComboBox.ItemContainerStyle>
            <Style TargetType="ComboBoxItem">
                <Setter Property="Height" Value="50" />
                <Setter Property="Width" Value="50" />
            </Style>
        </ComboBox.ItemContainerStyle>
  </ComboBox>
adminSoftDK
  • 2,012
  • 1
  • 21
  • 41