5

Ok, I would have thought this was a simple question, but apparently it's got me confused.

When I try to set the height of my RibbonComboBox, it's not moving actual size of it, just the box that surrounds it.

alt text

Here is my XAML:

<ribbon:RibbonComboBox                                                           
    DisplayMemberPath="CompanyCode" 
    Height="22" 
    Margin="0,0,0,-30" 
    VerticalAlignment="Bottom" 
    Width="102">
  <ribbon:RibbonGallery SelectedValue="{Binding Path=Companies.SelectedItem,
                                                ValidatesOnDataErrors=true,
                                                NotifyOnValidationError=true }">
    <ribbon:RibbonGalleryCategory ItemsSource="{Binding Path=Companies.Items, 
                                                        NotifyOnValidationError=true, 
                                                        ValidatesOnDataErrors=true}" />
  </ribbon:RibbonGallery>
</ribbon:RibbonComboBox>

I can change the height to 200 or 1 but the height never changes.

What am I doing wrong?

Thanks, Eroc

mram888
  • 4,899
  • 5
  • 33
  • 59
ErocM
  • 4,505
  • 24
  • 94
  • 161

2 Answers2

3

You can change the height easily if you set the DropDownHeight

René Winter
  • 409
  • 1
  • 4
  • 10
1

The Height is Hardcoded inside the style. It's probably because the control must behave in a Ribbon environment, which means it's must be standard.

One simple hack is to reach for the proper Border with the VisualTreeHelper and change his height.

Philippe Lavoie
  • 2,583
  • 5
  • 25
  • 39