Seven
Seven

Reputation: 4425

How to change font size in a WPF combobox for its popup only

In my WPF application I have a ComboBox. What I try to do is, to set a different font size on the popup only. The display of the selected item within the collapsed ComboBox should remain as it currently is.

Although I dismantled the whole thing to item templates and control templates in my XAML, I did not yet succeed to size only the popup's text...

Maybe one of you could give me the right point for doing so.

Upvotes: 0

Views: 3437

Answers (1)

dkozl
dkozl

Reputation: 33364

You can change ItemContainerStyle for ComboBoxItem

<ComboBox ...>
    <ComboBox.ItemContainerStyle>
        <Style TargetType="{x:Type ComboBoxItem}">
            <Setter Property="FontSize" Value="20"/>
        </Style>
    </ComboBox.ItemContainerStyle>
</ComboBox>

this should affect only items in the popup

Upvotes: 4

Related Questions